142). What kind of scoping does JavaScript use?

[A]Literal
[B]Lexical
[C]Segmental
[D]Sequential

Show Answer

143). What must be done in order to implement Lexical Scoping?

[A]Get the object
[B]Dereference the current scope chain
[C]Reference the current scope chain
[D]Return the value

Show Answer

144). What is closure?

[A]Function objects
[B] Scope where function’s variables are resolved
[C]Both Function objects and Scope where function’s variables are resolved
[D]Function return value

Show Answer

145). Which of the following is not an example of closures?

[A]Objects
[B]Variables
[C]Functions
[D]Graphics

Show Answer

146). Which of the following uses a lot of CPU cycles?

[A]GUI
[B]Statically generated graphics
[C]Dynamically generated graphics
[D]Generic scoping

Show Answer

147). What will be the function of the following JavaScript code?
var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

[A] Returns value null
[B]Returns exception
[C]Returns the value in scope
[D]Shows an error message

Show Answer

148). What is the fundamental rule of lexical scoping?
var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

[A]Functions are declared in the scope
[B]Functions are executed using scope chain
[C] Functions are declared outside the scope
[D]Variables are declared within the function

Show Answer

149). What is the opposite approach to the lexical scoping?
var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

[A] Literal scoping
[B]Static scoping
[C]Dynamic scoping
[D]Generic scoping

Show Answer

150). What is the purpose of the dynamic scoping?
var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

[A]Variables can be declared outside the scope
[B]Variables must be declared outside the scope
[C]Variables cannot be declared outside the scope
[D]Variable cannot be declared within the function

Show Answer

151). Which of the algorithmic languages is not lexical scoping standardized in?
var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

[A]Ada
[B]Pascal
[C]Modula2
[D]Html

Show Answer