Koenig Course for JavaScript and jQuery Quiz Questions and Answers

JavaScript is a ________ Side Scripting Language.

Answer :
  • Browser

If you want to stop your jQuery for a few milliseconds, which function do you use?

Answer :
  • delay()

Which was the first browser to support JavaScript?

Answer :
  • Netscape

JavaScript is ________ language.

Answer :
  • an interpreted

Predict the output on the console for the following JavaScript code. < script > function showNumber { if(true) { var a = 5; } document.write(a); } showNumber(); < /script >

Answer :
  • 5

Which function of an Array object calls a function for each element in the array?

Answer :
  • forEach()

Which of the following is the correct syntax to display “Koenig” in an alert box using JavaScript?

Answer :
  • alert(“Koenig”);

What is the correct jQuery code to set the background color of all p elements to red?

Answer :
  • $( "p ").css( "background-color ", "red ");

$(document).ready(function() { // Some code. }); The above code is used to_______.

Answer :
  • Make sure no code is executed till the DOM is fully loaded

What would be the output of the following code function greet() { return "Hello "; } console.log(greet());

Answer :
  • undefined