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 (B)</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 (C)</p> Signup and view all the answers

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

    <p>True (B)</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 (A)</p> Signup and view all the answers

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

    <p>Typeof (D)</p> Signup and view all the answers

    What is the purpose of the ^ operator in JavaScript?

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

    What is the equivalent statement for x += y?

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

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

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

    What is the purpose of the ! operator in JavaScript?

    <p>Logical NOT (A)</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 (B)</p> Signup and view all the answers

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

    <p>(A)</p> Signup and view all the answers

    What type of operator is the || operator?

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

    What is the purpose of the % operator in JavaScript?

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

    What is the purpose of JavaScript in web development?

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

    How do you input a comment in HTML?

    <p>(D)</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser