-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallbackfunction.js
More file actions
31 lines (19 loc) · 587 Bytes
/
callbackfunction.js
File metadata and controls
31 lines (19 loc) · 587 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//in js a. callback function is a function that is passed into another function as an argument
//this function can then be invoked at later stage of time;
//function printFirstname(firstname, cb){
// console.log(firstname)
// cb("Mahanta")
//}
///function Printlastname(lastname){
/// console.log(lastname)
//}
//printFirstname("Partha",Printlastname)//callback
//
const isEven=(n)=>{
return n%2==0;
}
let printresult=(evenfn,num)=>{
const isNumEven=evenfn(num)
console.log(`the number ${num} is an even number ${isNumEven}`)
}
printresult(isEven,19)