πŸ“Š JavaScript
Q. JavaScript Code can be called by using
  • (A) Preprocessor
  • (B) Function/Method
  • (C) RMI
  • (D) Triggering Event
πŸ’¬ Discuss
βœ… Correct Answer: (B) Function/Method

Explanation:

In JavaScript, code can be executed in multiple ways, but the most common and structured way is through functions or methods. A function is a reusable block of code that performs a specific task when called.

Example of Calling JavaScript Code Using a Function:

function greet() {
console.log("Hello, World!");
}
greet(); // Calling the function

Why Not Other Options?

(A) Preprocessor β†’ ❌ Incorrect
JavaScript is an interpreted language, meaning it does not require preprocessing like languages such as C or C++.

(C) RMI (Remote Method Invocation) β†’ ❌ Incorrect
RMI is a Java-based technology used for remote procedure calls, not for JavaScript execution.

(D) Triggering Event β†’ ❌ Partially Correct
Events like onClick, onLoad, etc., can execute JavaScript, but they usually call functions to perform the actual logic.

Final Answer:

βœ… (B) Function/Method

Explanation by: Mr. Dubey

In JavaScript, code can be executed in multiple ways, but the most common and structured way is through functions or methods. A function is a reusable block of code that performs a specific task when called.

Example of Calling JavaScript Code Using a Function:

function greet() {
console.log("Hello, World!");
}
greet(); // Calling the function

Why Not Other Options?

(A) Preprocessor β†’ ❌ Incorrect
JavaScript is an interpreted language, meaning it does not require preprocessing like languages such as C or C++.

(C) RMI (Remote Method Invocation) β†’ ❌ Incorrect
RMI is a Java-based technology used for remote procedure calls, not for JavaScript execution.

(D) Triggering Event β†’ ❌ Partially Correct
Events like onClick, onLoad, etc., can execute JavaScript, but they usually call functions to perform the actual logic.

Final Answer:

βœ… (B) Function/Method

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
294
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Kirti
Publisher
πŸ“ˆ
90%
Success Rate