Search Header Logo

JavaScript Quiz | For Beginners

Authored by Supreme-Cat Support

Computers

1st Grade - University

Used 2+ times

JavaScript Quiz | For Beginners
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to display “CodeMaster” in an alert box using JavaScript?

alertbox(“CodeMaster”);

alert{“CodeMaster”};

alert(CodeMaster);

alert(“CodeMaster”);

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for referring to an external script called “script.js”?

<script src=”script.js”>

<script href=”script.js”>

<script ref=”script.js”>

<script src=”script.js()”>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following JavaScript code:

<script type="text/javascript">

a = 8 + "8";

document.write(a);

</script>

16

Compilation Error

88

Run Time Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following JavaScript code.

<script type="text/javascript">


var a="GeeksforGeeks";

var x=a.lastIndexOf("G");

document.write(x);

</script>

8

0

9

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a reserved word in JavaScript?

interface

throws

program

short

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following JavaScript code:


<script type="text/javascript" language="javascript">

var x=5;

var y=6;

var res=eval("x*y");

document.write(res);

</script>

“30”

30

5*6

“5*6”

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which built-in method returns the character at the specified index?

characterAt()

getCharAt()

charAt()

None of These

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?