Skip to content

Instantly share code, notes, and snippets.

@ar5had
Created August 4, 2017 16:37
Show Gist options
  • Save ar5had/aa522a6fe698228dd3dc0fbaa3c5843f to your computer and use it in GitHub Desktop.
Save ar5had/aa522a6fe698228dd3dc0fbaa3c5843f to your computer and use it in GitHub Desktop.
// #1
// Polyfill a few basic things.
['filter', 'forEach', 'map', 'reduce'].forEach(function (name) {
Array[name] = function (array, callback, init) {
return [][name].call(array, callback, init);
};
});
// Automatically set up asynchronous JSON forms (all with a 'method' attribute).
// Array.forEach(document.querySelectorAll('form'), function (form) { ....
// url - https://github.com/jankeromnes/janitor/blob/ec1b1f7f0c955d18047be8460a75e46fbd33bf60/static/js/janitor.js
// #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment