JavaScript Day 2

JavaScript Day 2

University

10 Qs

quiz-placeholder

Similar activities

Understanding Arrays in Programming

Understanding Arrays in Programming

University

10 Qs

Java 101

Java 101

10th Grade - University

10 Qs

[Kelas 8 SMP] Bab 1 - Bahasa Program Java

[Kelas 8 SMP] Bab 1 - Bahasa Program Java

8th Grade - University

10 Qs

JS QUIZ

JS QUIZ

University

8 Qs

Recordando JavaScript

Recordando JavaScript

University

10 Qs

Test de JavaScript

Test de JavaScript

University

10 Qs

Java Strings

Java Strings

1st Grade - Professional Development

10 Qs

Javascript тілі

Javascript тілі

University

10 Qs

JavaScript Day 2

JavaScript Day 2

Assessment

Quiz

Other

University

Hard

Created by

Abdul Roshan

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following is a correct way to declare a variable in JavaScript?

variable name = 'John';

let name = 'John';

const name = 'John';

var name 'John';

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a primitive data type in JavaScript?

Number

String

Object

Boolean

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following expression: '5' + 3?

8

53

35

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

var x = 10;

if (true) {

var x = 20;

}

console.log(x);

10

20

Undefined

Null

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

let y = 10;

if (true) {

let y = 20;

}

console.log(y);

10

20

Error

Undefined

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to convert all the lowercase letters in a string to uppercase in JavaScript?

toLowerCase()

toUpperCase()

capitalize()

uppercase()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following declarations will result in an error if the variable is reassigned or redeclared?

var name = 'John';

let name = 'John';

const name = 'John';

var name;

name = 'John';

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?