re: 10 JavaScript array methods you should know VIEW POST

TOP OF THREAD FULL DISCUSSION
re: He asked about [1, 2, 3, 4, 5, 6] and not Array(7), is it the same?

it is essentially the same, I just pointed out what is a better comparison case with quote from the mdn docs

Your quote from MDN has nothing to do with the question though.
const arr = [7] and const arr = Array.of(7) will give exactly the same resut.

> const arr1 = Array(7);
> const arr2 = [7];
> const arr3 = Array.of(7);

> arr1
[ <7 empty items> ]
> arr2
[ 7 ]
> arr3
[ 7 ]
> 
code of conduct - report abuse