
Show HN: Essential functions in JavaScript in vanilla form (inspired by PHP) - amitmerchant
https://github.com/amitmerchant1990/essential-vanilla-javascript-functions
======
onion2k
Javascript has array_map called Array.prototype.map(), it has an array_merge
method called Array.prototype.concat(), array_reject can be achieved using
Array.prototype.filter() and so on. These functions are a poor
reimplementation of some native features.

~~~
brudgers
The implementation of the functions can be refactored to call the methods of
Arrray.prototype and Javascript's prototypical inheritance means that the
abstractions in the library will remain robust even if the refactoring were
done during runtime.

The value of the library is improving the names of the abstractions over
arrays in a way that may better express a particular programmer's thought
process. Better expressing a particular programmer's thought process via
abstraction is why we don't all write in machine code.

------
krapp
Why not actually push a .js file instead of just examples in a readme?

Or, I guess the modern method would be why not publish every line of every
function as a separate NPM package?

------
drivingmenuts
Well, there's always this: [http://locutus.io/php/](http://locutus.io/php/)

PHP functions written in Javascript. Been around for quite a while, actually.

