Which of the following is the correct way to include an external JavaScript file in HTML?

JavaScript Quiz

Quiz
•
Design
•
10th Grade
•
Easy
uthira C
Used 11+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
<script src="app.js"></script>
<script href="app.js"></script>
<link src="app.js"></link>
<style src="app.js"></style>
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to declare a variable in JavaScript?
var x = 10;
variable x = 10;
x := 10;
let 10 = x;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the result of the following code be? let a = 10 + "5";
15
105
50
Undefined
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used to assign a value to a variable?
==
===
=
=>
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? let age = 18; if (age >= 18) { console.log("You are an adult."); } else { console.log("You are a minor."); }
"You are a minor."
"You are an adult."
Error
Undefined
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the result of this code be? let num = 7; if (num % 2 === 0) { console.log("Even number"); } else { console.log("Odd number"); }
Even number
Odd number
Undefined
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to define a function in JavaScript?
function myFunction() { }
def myFunction() { }
func myFunction() { }
create function myFunction() { }