Test your JavaScript Skills:Fundamentals-5

Photo by Carlos Muza on Unsplash

Test your JavaScript Skills:Fundamentals-5

Part 5

Introduction

Namaste, In this blog I will discuss 7 FAQs on Javascript fundamentals.

Video Tutorial

  1. Identify the output of the below program

     let $=20;
     console.log("value", $);
    

    a.error

    b.20

    c.undefined

    d. null

    e.no output

    Answer:b

    Reason: $ is a valid variable name.

  2. Identify the output of the below program

     let _=100;
     console.log("value", _);
    

    a.error

    b.null

    c.undefined

    d. 100

    e.no output

    Answer:d

    Reason: _ is a valid variable name.

  3. Identify the output of the below program

     let ರಾಮ್ = "Ram";
     console.log("value", ರಾಮ್);
    

    a.error

    b.undefined

    c.Ram

    d. null

    e.no output

    Answer:c

    Reason: ರಾಮ್ is a valid variable name.

  4. Identify the output of the below program

     let राम = "Ram";
     console.log("value", राम);
    

    a.Ram

    b.error

    c.undefined

    d. null

    e.no output

    Answer: a

    Reason: राम is a valid variable name.

  5. Identify the output of the below program

     let class= "JS";
     console.log("value", class);
    

    a.JS

    b.class

    c.error

    d. undefined

    e.null

    Answer: c

    Reason: Here class is a reserved word, reserved words cannot be used as variables.

  6. Identify the output of the below program

     let function = 10;
     console.log("value", function);
    

    a.error

    b.10

    c.undefined

    d. null

    e.no output

    Answer: a

    Reason: Here function is a reserved word.Cannot use reserved words as variable names.

  7. Identify the output of the below program

     let राम = "Ram";
     console.log("type", typeof राम);
    

    a.error

    b.string

    c.null

    d. undefined

    e.no output

    Answer:b

    Reason: Since राम is a valid variable and holds string data the type is a string.

Video Tutorial

Did you find this article valuable?

Support Programming with Mahavir by becoming a sponsor. Any amount is appreciated!