Skip to content

Instantly share code, notes, and snippets.

View nealalan's full-sized avatar

nealalan nealalan

View GitHub Profile
@nealalan
nealalan / js-polyfilling.md
Created August 6, 2019 00:06
JavaScript Polyfilling

POLYFILLING

  • taking the definition of a newer feature and producing a piece of code that's equivalent to the behavior, but is able to run in older JS environments.
if (!Number.isNaN) {
	Number.isNaN = function isNaN(x) { return x !== x; };
}
  • Use a vetted set of polyfills that you can trust, such as those provided by ES5-Shim and ES6-Shim