MCQ Single Best Answer Not Set

QDoes the following JavaScript code work?
var js = (function(x) {return x*x;}(10));

ID: #4836 Basic JavaScript MCQ 558 views
Question Info
#4836Q ID
Not SetDifficulty
Basic JavaScript MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Exception will be thrown
  • B Yes, perfectly
  • C Error
  • D Memory leak
Correct Answer: Option B

Explanation

For functions expressed as expressions, the function name is optional in Javascript. A function expression may be defined and used in the same way.

Share This Question

Challenge a friend or share with your study group.