πŸ“Š JavaScript
Q. JavaScript can be written
  • (A) directly into JS file and included into HTML
  • (B) directly on the server page
  • (C) directly into HTML pages
  • (D) all of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) all of the mentioned

Explanation:

JavaScript can be written in multiple ways:

Directly into a .js file and included into an HTML page

  • Example:

Directly on the server page

  • JavaScript can be used in server-side environments like Node.js.

Directly into HTML pages using the <script> tag

  • Example:

Thus, JavaScript supports all these methods, making (D) all of the mentioned the correct answer.

<script>
alert("Hello, JavaScript!");
</script>
<script src="script.js"></script>

Explanation by: Official MCQ Buddy

JavaScript can be written in multiple ways:

Directly into a .js file and included into an HTML page

  • Example:

Directly on the server page

  • JavaScript can be used in server-side environments like Node.js.

Directly into HTML pages using the <script> tag

  • Example:

Thus, JavaScript supports all these methods, making (D) all of the mentioned the correct answer.

<script>
alert("Hello, JavaScript!");
</script>
<script src="script.js"></script>

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
298
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
80%
Success Rate