DEV Community

loading...
Cover image for When was JS Array.Map() first included? ES5? ES6?

When was JS Array.Map() first included? ES5? ES6?

raddevus
Software Dev & Tech Writer. Created CYaPass.com app so you never have to make up, type or memorize a password again.
・1 min read

Wikipedia Versus W3Schools Throw-down!

wikipedia versus w3schools throwdown
I am attempting to discover when Array.Map() function was originally included in JavaScript.

wikipedia says it was ES6 (6th Edition – ECMAScript 2015) Read the paragraph the link takes you to and you will see it mentions... "new collections (maps, sets and WeakMap)..."

However, W3Schools says it was first included in ES5 (2009).

The link displays numerous items include Array.Map().

Do you know when it was first added?

Thanks

Answer My Own Question

Very interesting because I thought it was first added to ES6, however, I found the official ES5 (2009) Spec PDF and found the following:

es5 spec shows Array.map()

Of course, it is also defined in the ES6 Spec...

ES6 spec Array.map()

Was Just Wondering How Long It's Been Around

I had been under the impression it wasn't available until 2015, but it looks as if some browsers as far back as 2010 or so may have included it.

Discussion (0)

Forem Open with the Forem app