FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
basic-programs/javascript/Callbacks/simple-callback.js at master · commitRahul/basic-programs · GitHub
commitRahul
/
basic-programs
Public
forked from
starVader/basic-programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
basic-programs
/
javascript
/
Callbacks
/
simple-callback.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (16 loc) · 432 Bytes
Breadcrumbs
basic-programs
/
javascript
/
Callbacks
/
simple-callback.js
Copy path
File metadata and controls
19 lines (16 loc) · 432 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// callbacks as simple functions
function
sayHello
(
name
)
{
console
.
log
(
`Hello
${
name
}
`
)
;
}
function
askQuestion
(
name
)
{
console
.
log
(
`
${
name
}
, how are you today?`
)
;
}
/**
*
@param
{
string
} Whatever name you like
*
@param
{
Function
} Just another function to "extend" the functionality of this function
*/
function
main
(
name
,
callback
)
{
callback
(
name
)
;
}
main
(
'John Doe'
,
sayHello
)
;
main
(
'Jane Roe'
,
askQuestion
)
;
Back
|
FazBrowse Home
|
New Git URL