Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

  1. What will happen if you reference document.location from within an object?

  2. A.

     Traverses the queue

    B.

     Finds the bugs

    C.

     Traverses the stack

    D.

     None of the mentioned

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    If you reference document.location from within an object, the interpreter will need to go from the function that references the variable, up out of the namespace to the global window scope, down to the document scope, and get the location value.


Be The First To Comment