Skip to content

Commit 8ada061

Browse files
committed
docs: updated
1 parent eac0ea3 commit 8ada061

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

docs/13-functions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ In this Session, you will learn to:
1313
- Explain JSON
1414

1515
---
16+
17+
## 12.1 Introduction
18+
Consider a scenario where a Web page has been designed to greet the user with his/her name on the click of a button. A code can be used here to accomplish this task, but may result in the same output on repetitive executions. However, writing these statements each time for the same action is tedious, time consuming, and error prone.
19+
20+
To make the code more task-oriented and manageable, JavaScript allows to group statements before they are actually invoked. This can be achieved by using the concept of functions. A function is a reusable block of code that is executed on the occurrence of an event. The event can be a user action on the page or a call within the script.

0 commit comments

Comments
 (0)