A

Admin • 833K Points
Coach

Q. The “var” and “function” are __________.

  • (A) Prototypes
  • (B) Data types
  • (C) Keywords
  • (D) Declaration statements
  • Correct Answer - Option(D)
  • Views: 32
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

var is used to declare variables.

  • function is used to declare functions.

Both are declaration statements because they define variables and functions before execution.

Example:

var x = 10;  // Variable declaration
function greet() { // Function declaration
console.log("Hello!");
}

Why Not Other Options?

  • (A) Prototypes → Incorrect. Prototypes are used in object-oriented JavaScript but var and function are not prototypes.
  • (B) Data types → Incorrect. var and function are not data types like string, number, etc.
  • (C) Keywords → Partially correct, but they are mainly declaration statements, not just reserved words.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.