How function can be used as arguments to other function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How function can be used as arguments to other function

28th Jan 2019, 3:37 PM
Sahil Javed Khan
Sahil Javed Khan - avatar
2 Answers
+ 1
Thanks man
28th Jan 2019, 7:31 PM
Sahil Javed Khan
Sahil Javed Khan - avatar
0
JS example: let x=1; function two(){ return 2; } function add(a,b){ return a+b; } document.write(add(two(),x)); //output 3
28th Jan 2019, 5:15 PM
Игорь Яковенко
Игорь Яковенко - avatar