Skip to content

Instantly share code, notes, and snippets.

@nealalan
Created August 6, 2019 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nealalan/9c0c108c098b010f47853709dcd62d57 to your computer and use it in GitHub Desktop.
Save nealalan/9c0c108c098b010f47853709dcd62d57 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment