Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 MCQs JavaScript Application Development

CSE326 — Internet Programming Laboratory 50 questions. Pick an option to check it.

Read the notes

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    Which HTML tag is used to embed JavaScript code inside a webpage?

  2. Question 2 of 50

    Which attribute of the <script> tag is used to include an external JavaScript file?

  3. Question 3 of 50

    Where is the correct place to insert a JavaScript in an HTML document?

  4. Question 4 of 50

    What is the correct file extension for an external JavaScript file?

  5. Question 5 of 50

    How do you write 'Hello World' in an alert box?

  6. Question 6 of 50

    Which keyword is used to declare a variable that cannot be reassigned?

  7. Question 7 of 50

    What is the scope of a variable declared with 'let' inside a block?

  8. Question 8 of 50

    Which operator is used to check both value and type equality?

  9. Question 9 of 50

    What is the result of the expression: '5' + 3?

  10. Question 10 of 50

    Which function is used to get input from the user?

  11. Question 11 of 50

    What does the confirm() method return?

  12. Question 12 of 50

    How does a 'while' loop start?

  13. Question 13 of 50

    Which statement is used to stop a loop completely?

  14. Question 14 of 50

    What is the purpose of the 'continue' statement?

  15. Question 15 of 50

    Which loop is guaranteed to execute at least once?

  16. Question 16 of 50

    How do you write an IF statement in JavaScript?

  17. Question 17 of 50

    How do you write an IF statement for executing some code if 'i' is NOT equal to 5?

  18. Question 18 of 50

    Which symbol is used for single-line comments in JavaScript?

  19. Question 19 of 50

    What is the correct syntax for referring to an external script called 'app.js'?

  20. Question 20 of 50

    How do you create a JavaScript object?

  21. Question 21 of 50

    Given: var person = {firstName:'John', lastName:'Doe'}; How do you access the lastName?

  22. Question 22 of 50

    Which keyword is used to define a variable in JavaScript (ES5 legacy)?

  23. Question 23 of 50

    What is the correct way to write a JavaScript array?

  24. Question 24 of 50

    Inside which HTML element do we put the JavaScript?

  25. Question 25 of 50

    What will be the output of: typeof 'Hello'?

  26. Question 26 of 50

    Which statement serves as the fall-back in a 'switch' statement?

  27. Question 27 of 50

    What is the correct syntax for a 'for' loop?

  28. Question 28 of 50

    How can you add a comment that has more than one line?

  29. Question 29 of 50

    Which operator is used to assign a value to a variable?

  30. Question 30 of 50

    What is the value of 'x' after: var x = 10; x += 5;

  31. Question 31 of 50

    Which keyword identifies a block of code to be executed if a specified condition is false?

  32. Question 32 of 50

    In an object method, what does 'this' refer to?

  33. Question 33 of 50

    Which logical operator represents 'OR'?

  34. Question 34 of 50

    What is the correct way to check if a variable 'car' is undefined?

  35. Question 35 of 50

    Which of the following is NOT a valid JavaScript variable name?

  36. Question 36 of 50

    What syntax is used to access a method 'start' of an object 'engine'?

  37. Question 37 of 50

    What happens if you redeclare a variable using 'let' in the same scope?

  38. Question 38 of 50

    Which property is used to find the length of a string?

  39. Question 39 of 50

    What is the output of Boolean(10 > 9)?

  40. Question 40 of 50

    Which is the ternary operator?

  41. Question 41 of 50

    What keyword defines a switch case block?

  42. Question 42 of 50

    How do you delete a property from a JavaScript object?

  43. Question 43 of 50

    Which popup box returns null if the user clicks 'Cancel'?

  44. Question 44 of 50

    What is Hoisting in JavaScript?

  45. Question 45 of 50

    Which of the following is a valid const declaration?

  46. Question 46 of 50

    What loop is best suited for iterating over the properties of an object?

  47. Question 47 of 50

    Which symbol is used for the modulus (remainder) operator?

  48. Question 48 of 50

    If x = 10 and y = '10', what is the result of x == y?

  49. Question 49 of 50

    If x = 10 and y = '10', what is the result of x === y?

  50. Question 50 of 50

    Which global object do alert(), confirm(), and prompt() belong to?

That's unit 4

Answer a few questions and your score shows up here.