Functional Programming in JavaScript

Functional Programming in JavaScript

1st - 5th Grade

7 Qs

quiz-placeholder

Similar activities

Kuis Adu Cepat Matematika

Kuis Adu Cepat Matematika

3rd - 6th Grade

10 Qs

Wk 2 - LP-1 Even and odd numbers

Wk 2 - LP-1 Even and odd numbers

2nd Grade

11 Qs

Fracciónes

Fracciónes

2nd - 10th Grade

12 Qs

Primary 3

Primary 3

3rd Grade

10 Qs

Fraction

Fraction

4th Grade

10 Qs

二年级数学评估(一)

二年级数学评估(一)

2nd Grade

10 Qs

Multiplying 2

Multiplying 2

2nd Grade

9 Qs

Actividad final- 2parte-third

Actividad final- 2parte-third

3rd Grade

10 Qs

Functional Programming in JavaScript

Functional Programming in JavaScript

Assessment

Quiz

Mathematics

1st - 5th Grade

Practice Problem

Hard

Created by

Anonymous Anonymous

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

7 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Let point be an object { x: 0, y: 0 }. What is the result of { x: 1, ...point }?

{ x: 0, y: 0 }

{ x: 0, y: 1 }

{ x: 1, y: 0 }

{ x: 1, y : 1 }

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

What is the output of the console.log?

{ x: 0, y: 0 }

[ 0, 0 ]

undefined

[Function: getPoint]

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

What will happen if the following code is executed?

A SyntaxError will be raised in the first line.

A SyntaxError will be raised in the second line.

The console.log will output [] (i.e. the empty array)

The console.log will output [Function (anonymous)]

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What does { ...obj1, ...obj2 } do (assuming that obj1 and obj2 are objects)?

Creates a new object containing obj1 and obj2 as properties.

Creates a new object containing the keys of obj1 and obj2 as properties.

Creates a new object containing keys of obj1 and obj2 as properties unless obj1 or obj2 have equal keys.

Copies obj2 into obj1.

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of these statements about the filter method is true?

It retrieves all of the elements that meet a certain predicate

The returned elements are deep copied

The returned elements are shallow copied

It only works for primitive values

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What does the expression Object.entries({ x: 0, y: 0 }).map(([x1, x2]) => [x1, x2]) return?

{ x: 0, y: 0 }

[ [ 'x', 0 ], [ 'y', 0 ] ]

Nothing, a SyntaxError will happen

[ 0, 0 ]

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of these statements are true about pure functions?

They have no side effects

They are easily testable

They don't mutate global state

Their output(s) depends only on their input(s)