Search Header Logo

JavaScript Basics Quiz

Authored by Sharfuddin Hyder

Other

University

Used 3+ times

JavaScript Basics Quiz
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

What is the correct way to declare a JavaScript variable?

variable x;

v x;

var x;

let = x;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a JavaScript data type?

String

Boolean

Float

Undefined

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write "Hello, World!" in an alert box?

alert("Hello, World!");

msgBox("Hello, World!");

msg("Hello, World!");

alertBox("Hello, World!");

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

How do you write a single-line comment in JavaScript?

<!-- This is a comment -->

// This is a comment

/* This is a comment */

** This is a comment **

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will console.log(typeof []) output?

array

object

list

undefined

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a function in JavaScript?

function = myFunction() {}

function myFunction() {}

create function myFunction() {}

def myFunction() {}

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?