JavaScript and HTML Basics
18 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

What is the output of console.log(x | y) where x = 7 and y = 6?

  • 7
  • 6
  • Error
  • 8 (correct)
  • What is the purpose of the # symbol in CSS?

  • ID selector (correct)
  • Attribute selector
  • Class selector
  • Tag selector
  • What is the keyword used to declare a variable in JavaScript that cannot be changed?

  • Type
  • Let
  • Const (correct)
  • Var
  • What is the logical operator that checks if two conditions are true?

    <p>Logical AND</p> Signup and view all the answers

    What will be the output of the expression y % x when y = 5 and x = 3?

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

    What is the output of console.log(x &gt; 3) where x = 5?

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

    What is the purpose of cookies in web development?

    <p>To store small pieces of data on the client-side</p> Signup and view all the answers

    What is the operator that returns a string indicating the type of the operand?

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

    What is the purpose of the ^ operator in JavaScript?

    <p>Bitwise XOR</p> Signup and view all the answers

    What is the equivalent statement for x += y?

    <p>x = x + y</p> Signup and view all the answers

    What is the purpose of the === operator in JavaScript?

    <p>Equal value and equal type</p> Signup and view all the answers

    What is the purpose of the ! operator in JavaScript?

    <p>Logical NOT</p> Signup and view all the answers

    What is the purpose of the const keyword in JavaScript?

    <p>To declare variables that should remain constant and cannot be reassigned</p> Signup and view all the answers

    What is the correct syntax for linking an external CSS file to an HTML document?

    Signup and view all the answers

    What type of operator is the || operator?

    <p>Logical operator</p> Signup and view all the answers

    What is the purpose of the % operator in JavaScript?

    <p>To perform modulus operation</p> Signup and view all the answers

    What is the purpose of JavaScript in web development?

    <p>To develop interactivity to HTML</p> Signup and view all the answers

    How do you input a comment in HTML?

    Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser