What convenience does the following JavaScript code? [code] let succ = function(x) x+1, yes = function() true, no = function() false; [/code] Wh

Julipkq

New member
What convenience does the following JavaScript code?
Code:
let succ = function(x) x+1, yes = function() true, no = function() false;
What convenience does the above code snippet provide?
A. Functional behaviour
B. Modular behaviour
C. No convenience
D. Shorthand expression
 
Answer: a
Explanation: The functions defined in this way behave exactly like functions defined with curly braces and the return keyword. The functions can be defined in a shorthand expression.
This set of JavaScript Multiple Choice Questions & Answers focuses on “Parsing Values using JavaScript – II”.
 

Tìm kiếm

Back
Top