The Journey of #100DaysOfCode (wassim_taleb)

๐ƒ๐š๐ฒ ๐Ÿ๐Ÿ: ๐ฆ๐š๐ฉ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง ๐ฏ๐ฌ. ๐€๐ซ๐ซ๐š๐ฒ.๐Ÿ๐ซ๐จ๐ฆ ๐ข๐ง ๐‰๐š๐ฏ๐š๐’๐œ๐ซ๐ข๐ฉ๐ญ

map Function and Array.from are used to create new arrays in JavaScript, but they ๐ฌ๐ž๐ซ๐ฏ๐ž ๐๐ข๐Ÿ๐Ÿ๐ž๐ซ๐ž๐ง๐ญ ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐ž๐ฌ and have distinct characteristics.

โ†’ ๐ฆ๐š๐ฉ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง: Transforms each element of an array according to a provided function, returning a new array of the same length. It is applied directly on an existing array.

โ†’ ๐€๐ซ๐ซ๐š๐ฒ.๐Ÿ๐ซ๐จ๐ฆ: Creates a new array instance from an array-like or iterable object, with an optional mapping function to transform elements during the creation of the new array.

2 Likes