JavaScript Set-2

Instruction:-

  • Number of Questions : 25
  • Total Marks : 25
  • Each question carry 1 Marks.
  • No negative marking

  •  

    Results

    #1. What is the output of this code?
    javascript
    CopyEdit
    console.log(3 + 4 + “5”);

    #2. What is the output of:
    javascript
    CopyEdit
    console.log(typeof null);

    #3. Which JavaScript method adds an element to the end of an array?

    #4. Which method can remove the last element of an array?

    #5. What does NaN stand for in JavaScript?

    #6. What will be the result of this code?
    javascript
    CopyEdit
    console.log(5 == “5”);

    #7. What will be the output of this code?
    javascript
    CopyEdit
    console.log(“10” + 1);

    #8. Which of these values is considered falsy in JavaScript?

    #9. What will this code return?
    javascript
    CopyEdit let fruits = [“apple”, “banana”];
    console.log(fruits[1]);

    #10. What is the output?
    javascript
    CopyEdit let a = 2;
    let b = 3;
    a += b;
    console.log(a);

    #11. How can you round the number 4.7 to the nearest integer?

    #12. What does the break statement do in a loop?

    #13. What will this code output?
    javascript
    CopyEdit
    let nums = [1, 2, 3];
    nums.push(4);
    console.log(nums.length);

    #14. What is the correct way to define an array in JavaScript?

    #15. Which of the following keywords declares a block-scoped variable?

    #16. Which HTML tag is used to include JavaScript code?

    #17. How do you write a single-line comment in JavaScript?

    #18. Which keyword is used to declare a variable that can be reassigned?

    #19. What will be the output of the following JavaScript code?
    javascript console.log(10 + “5”);

    #20. Which operator checks for both value and data type equality?

    #21. Which method is used to get an HTML element by its unique ID?

    #22. What is the correct way to define a JavaScript function?

    #23. In an array myArray = [10, 20, 30, 40];, what is the value of myArray[2]?

    #24. Which event occurs when a user clicks on an HTML element?

    #25. What is the primary purpose of JavaScript in a web page?

    Previous
    Finish

    Leave a Comment

    Your email address will not be published. Required fields are marked *