Intermediate JavaScript
Q73 / 100

What is the difference between Array.from() and Array.of()?

Correct! Well done.

Incorrect.

The correct answer is B) Array.from() creates an array from an iterable or array-like object; Array.of() creates an array from its arguments without the length-coercion of new Array()

B

Correct Answer

Array.from() creates an array from an iterable or array-like object; Array.of() creates an array from its arguments without the length-coercion of new Array()

Explanation

Array.from("abc") = ["a","b","c"]. Array.of(3) = [3] (not [undefined, undefined, undefined] like new Array(3)).

Progress
73/100