wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Javascript Fundamental Practice

Total questions: 20

Worksheet time: 2hrs 40mins

Name
Class
Date
1.

What is the output of this code?

a)

error arr[3](arr[2].address) is not a function

b)

hello 22 Main st

c)

helloundefined

d)

true

2.

What is the output of this code?

a)

error .join() is not a function

b)

error .split() is not a function

c)

J A J A N G S I P E M B U R U

d)

JAJANGSIPEMBURU

3.

What is the output of this code?

a)

33

b)

2

c)

9

d)

error .sort is not invoked

4.

const str = 'purwadhika jakarta'

How to get string "adhi"?

a)

str.substring(4, 7)

b)

str.slice(4, 7)

c)

str.substr(4, 8)

d)

str.substring(8, 4)

5.

What is the output of this code?

a)

10

false

NaN

b)

10

false

2

c)

true

false

false

d)

true

false

2

6.

What is the output of this code?

a)

-9

b)

"-9"

c)

6

d)

undefined

7.

What is the output of this code?

a)

[4,5,7,8,9,12]

b)

[12,9,8,7,5,4,3]

c)

undefined

d)

[3,4,5,7,8,9,12]

8.

Which data structure maps keys to values?

a)

Linked List

b)

Queue

c)

Stack

d)

None of these answers

9.

What is the output of this code?

a)
b)
c)
d)
10.

What is the output of this code?

a)

error unexpected end of input

b)

tidak lengkap

c)

camry masih baru

d)

data salah

11.

let a = [['deep'],[['deeper'], ['deeper']],[[['deepest'], ['deepest']],[[['deepest-est']]]]]

How to get 'deepest-est'?

a)

console['log'](a[2][1][0][0][0])

b)

console['log'](a[2][1][0][0])

c)

console.log(a[2][0][0][0][0])

d)

console[log](a[2][1][0][0][0])

12.

What is the output of this code?

a)

Purwadhika BSD, purwadhika Jakarta

b)

purwadhika Jakarta, purwadhika Jakarta

c)

undefined, purwadhika Jakarta

d)

Purwadhika Jakarta, Purwadhika BSD.

13.

What is the output of this code?

a)

Gundam { grade: 'Real Grade', size: 144, series: 'Mobile Suit Gundam' }

b)

RX78 { grade: 'Real Grade', size: 144, series: 'Mobile Suit Gundam' }

c)

Error, unexpected identifier

d)

Error, { grade: 'Real Grade', size: undefined, series: 'Mobile Suit Gundam' }

14.

let x = [1, 2, 3];

let y = [1, 2, 3];

console.log(x == y)?

a)

true

b)

false

15.

What are two parts to measuring efficiency?

a)

space and maintainability

b)

time and readability

c)

time and space complexity

d)

speed and maintenance complexity

16.

How to get:

['Jurus Jitu Togel', 'Harry Potter', 'Laskar Pelangi', 'Jurus Jitu Togel', 'Al-Quran', 'Dasar-Dasar Algoritma']

a)
b)
c)
d)
17.

var str = new String("abc")

console.log(typeof str)?

a)

string

b)

function

c)

object

d)

symbol

18.

Consider the following JavaScript statement containing regular expressions and check if the pattern matches.

var text = "testing: 1, 2, 3";

var pattern = /d+/g;

a)

pattern.test(text)

b)

text.check(pattern)

c)

text==pattern

d)

text.equals(pattern)

19.

What is the output of this code?

a)

error

b)

undefined

c)

false

d)

true

20.

What is the name of the technique used in the example code

a)

closure

b)

currying

c)

recursive

d)

refactor