JavaScript Statements - Advanced Web Programming Lab
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

How do you declare a variable in JavaScript?

  • Using the 'let' keyword
  • Using the 'var' keyword
  • Using the 'const' keyword
  • All of the above (correct)
  • What is the purpose of the 'typeof' operator in JavaScript?

  • To check the data type of a variable (correct)
  • To check if a variable is null
  • To check if a variable is a string
  • To check if a variable is undefined
  • What is the output of the expression '10 + '5' in JavaScript?

  • 15
  • 55 (correct)
  • Error
  • 105
  • How do you create a JavaScript object?

    <p>Using the '{}' syntax</p> Signup and view all the answers

    What is the purpose of the 'parseInt' function in JavaScript?

    <p>To convert a string to a number</p> Signup and view all the answers

    What is the output of the expression 'true ? 1 : 2' in JavaScript?

    <p>1</p> Signup and view all the answers

    How do you create a JavaScript function?

    <p>Using the 'function' keyword</p> Signup and view all the answers

    What is the purpose of the 'Math.random' function in JavaScript?

    <p>To generate a random number between 0 and 1</p> Signup and view all the answers

    How do you convert a string to uppercase in JavaScript?

    <p>Using the 'toUpperCase' method</p> Signup and view all the answers

    What is the purpose of the 'if' statement in JavaScript?

    <p>To execute a block of code if a condition is true</p> Signup and view all the answers

    More Like This

    JavaScript Statements Quiz
    4 questions
    Web Development Essentials Quiz
    13 questions

    Web Development Essentials Quiz

    ObtainableMahoganyObsidian5573 avatar
    ObtainableMahoganyObsidian5573
    Use Quizgecko on...
    Browser
    Browser