Q. Why is JavaScript called a structured programming language?

  • (A) Because all popular web browsers support JavaScript as they provide built-in execution environments
  • (B) Because it is an object-oriented programming language that uses prototypes rather than using classes for inheritance
  • (C) Because it follows the syntax and structure of the C programming language, which is a structured programming language
  • (D) Because it ignores spaces, tabs, and newlines that appear in JavaScript programs
πŸ’¬ Discuss
βœ… Correct Answer: (C) Because it follows the syntax and structure of the C programming language, which is a structured programming language

Q. Which of the following is the correct syntax to print a page using JavaScript?

  • (A) print();
  • (B) window.print();
  • (C) document.print();
  • (D) echo
πŸ’¬ Discuss
βœ… Correct Answer: (B) window.print();

Q. Which of the following is not a JavaScript Data Types?

  • (A) Boolean
  • (B) Undefined
  • (C) Number
  • (D) Float
πŸ’¬ Discuss
βœ… Correct Answer: (D) Float

Q. Which of the following is the correct JavaScript syntax to access the element using HTML code?

  • (A) getElement ("availablecourse").innerHTML = "See the list of availablecourse";
  • (B) getElementById ("availablecourse").innerHTML = "See the list of availablecourse";
  • (C) getId ("availablecourse") = "See the list of availablecourse";
  • (D) document.getElementById ("availablecourse").innerHTML = See the list of availablecourse;
πŸ’¬ Discuss
βœ… Correct Answer: (D) document.getElementById ("availablecourse").innerHTML = See the list of availablecourse;

Q. Which of the following function of the Array object is used to add one or more elements to the front of an array and returns the new length of the array?

  • (A) splice()
  • (B) unshift()
  • (C) sort()
  • (D) toString()
πŸ’¬ Discuss
βœ… Correct Answer: (B) unshift()

Q. Which of the following syntax is correct to refer to an external script called "LFC.js"?

  • (A) <script source="LFC.js">
  • (B) <script ref="LFC.js">
  • (C) <script src="LFC.js">
  • (D) <script type="LFC.js">
πŸ’¬ Discuss
βœ… Correct Answer: (C) <script src="LFC.js">

Q. Which of the following syntax can be used to write "Hello World" in an alert box?

  • (A) alertBox("Hello World");
  • (B) msgBox("Hello World");
  • (C) alert("Hello World");
  • (D) msg("Hello World");
πŸ’¬ Discuss
βœ… Correct Answer: (C) alert("Hello World");

Q. Which of the following is not a JavaScript framework or library?

  • (A) Polymer
  • (B) Meteor
  • (C) jQuery
  • (D) Cassandra
πŸ’¬ Discuss
βœ… Correct Answer: (D) Cassandra

Q. Why does the name of JavaScript and Java are similar?

  • (A) JavaScript is a stripped-down version of Java.
  • (B) The syntax of JavaScript is loosely based on the syntax of Java.
  • (C) JavaScript and Java both are originated on the island of Java.
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) The syntax of JavaScript is loosely based on the syntax of Java.

Q. Which of the following is the correct statement of WHILE loop start?

  • (A) while (i <= 10)
  • (B) while (i <= 10; i++)
  • (C) while i = 1 to 10
  • (D) None of These
πŸ’¬ Discuss
βœ… Correct Answer: (A) while (i <= 10)