Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

  1. Consider the following code snippet

    const pi=3.14;

    var pi=4;

    console.log(pi);

    What will be the output for the above code snippet?

  2. A.

     This will flash an error

    B.

     Prints 4

    C.

     Prints 3.14

    D.

     Ambiguity

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    The above code snippet will flash an error. Attempts to alter the value or re-declaration causes errors.


Be The First To Comment