So what is the difference between this two functions?
They both create new Array
object. Only difference I found so far is that Array.from
supp
The purpose of Array.from()
is to take a non-array (but array-like) object and make a copy of it into an actual array. This then allows you to use ALL array methods on the copy including things beyond just iterating it such as .splice()
, .sort()
, .push()
, .pop()
, etc... which is obviously much more capable than just make .map()
work with array-like things.