Array And Function MCQs
Practice Array And Function MCQs for competitive exams.
Array And Function MCQs
Practice questions from this topic.
Which of the algorithmic languages is lexical scoping standardized in?
Correct Answer: D
What is the purpose of the dynamic scoping?
Correct Answer: A
What is the opposite approach to the lexical scoping?
Correct Answer: C
What is the fundamental rule of lexical scoping?
Correct Answer: B
Consider the following code snippet : var scope = "global scope" ; function checkscope () { var scope = "local scope" ; function f () { return scope; } return f; What is the function of the above code snippet?
Correct Answer: C
Which of the following uses a lot of CPU cycles?
Correct Answer: C
Which of the following are examples of closures?
Correct Answer: D
What is a closure?
Correct Answer: C
What must be done in order to implement Lexical Scoping?
Correct Answer: C
What kind of scoping does JavaScript use?
Correct Answer: B
Consider the following code snippet : var c = counter () , d = counter () ; function constfuncs () { var funcs = [] ; for(var i = 0 ; i < 10 ; i ++ ) funcs [ i ] = function () { return i; } ; return funcs; } var funcs = constfuncs () ; funcs [ 5 ]() What does the last statement return ?
Correct Answer: C
Consider the following code snippet : var c = counter () , d = counter () ; c . count () d . count () c . reset () c . count () d . count () The state stored in d is :
Correct Answer: A
