Q. What was the original name of JavaScript when it discovered?

  • (A) LiveScript
  • (B) EScript
  • (C) JScript
  • (D) Mocha
πŸ’¬ Discuss
βœ… Correct Answer: (D) Mocha

Q. Which of the following is the correct way to write a comment in JavaScript code?

  • (A) //This is a comment
  • (B) /*This is a comment*/
  • (C) $This is a comment$
  • (D) **This is a comment**
πŸ’¬ Discuss
βœ… Correct Answer: (A) //This is a comment

Q. What would be the output of the following Javascript code?

Code:
var string1 = "Fee";  
var intvalue = 10000;  
alert( string1 + intvalue );
  • (A) Fee 10000
  • (B) 10000
  • (C) Fee10000
  • (D) Exception
πŸ’¬ Discuss
βœ… Correct Answer: (C) Fee10000

Q. Which of the following JavaScript operator is used to assign a value to a variable based on some condition?

  • (A) Assignment operator
  • (B) Bitwise Operator
  • (C) Conditional operator
  • (D) Logical Operator
πŸ’¬ Discuss
βœ… Correct Answer: (C) Conditional operator

Q. Which of the following variables are used in JavaScript programs?

  • (A) Varying randomly
  • (B) Causing high-school algebra flashbacks
  • (C) Storing numbers, dates, or other values
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Storing numbers, dates, or other values

Q. What are the three crucial manipulations done in a "for loop" on a loop variable in JavaScript?

  • (A) The initialization, the Increment, and update
  • (B) The initialization, the test, and the update
  • (C) The initialization, the test, and Increment
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) The initialization, the test, and the update

Q. Which of the following is the correct syntax to create a cookie using JavaScript?

  • (A) cookie = 'key1 = value1; key2 = value2; expires = date';
  • (B) cookie = 'key1 = value1; key2 = value2; expires = date';
  • (C) cookie = 'key1 = value1; key2 = value2; expires = date';
  • (D) cookie = 'key1 = value1; key2 = value2; expires = date';
πŸ’¬ Discuss
βœ… Correct Answer: (A) cookie = 'key1 = value1; key2 = value2; expires = date';

Q. What are the different alternatives of == and != in JavaScript?

  • (A) It uses bitwise checking
  • (B) It uses === and !== instead
  • (C) It uses equals() and notequals() instead
  • (D) It uses equalto()
πŸ’¬ Discuss
βœ… Correct Answer: (B) It uses === and !== instead

Q. What are the different types of Pop up boxes available in JavaScript?

  • (A) Alert
  • (B) Prompt
  • (C) Confirm
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation:

Let's solve it clearly:

In JavaScript, there are three types of popup boxes:

  1. Alert β€” shows a simple message with an OK button.
  2. Prompt β€” asks the user for input (shows an input box).
  3. Confirm β€” asks the user to confirm something (OK/Cancel buttons).

Thus, the correct answer is:

(D) All of the above

Q. Which of the following is a server-side JavaScript object?

  • (A) Date
  • (B) FileUpload
  • (C) File
  • (D) Function
πŸ’¬ Discuss
βœ… Correct Answer: (C) File