DEV Community

Discussion on: 13 useful JavaScript array tips and tricks you should know

froxxninethree profile image

I didn't know about the second parameter of Array.from() as well, but I don't actually see a reason to use it instead of in any situation.

michaeljsalo profile image
Michael J Salo

MDN says, "Array.from(obj, mapFn, thisArg) has the same result as Array.from(obj).map(mapFn, thisArg), except that it does not create an intermediate array." This suggests it might perform a little better, in extreme cases.