Skip to content

Instantly share code, notes, and snippets.

@ricealexander
Last active January 2, 2021 00:29
Show Gist options
  • Save ricealexander/1a5515d1adcc72c73a70bc5f4c31d1ce to your computer and use it in GitHub Desktop.
Save ricealexander/1a5515d1adcc72c73a70bc5f4c31d1ce to your computer and use it in GitHub Desktop.
A collection of prototype methods that have a different name than their original proposal
// Array.prototype.contains: https://esdiscuss.org/topic/having-a-non-enumerable-array-prototype-contains-may-not-be-web-compatible
// Array.prototype.flatten: https://developers.google.com/web/updates/2018/03/smooshgate
// String.prototype.contains: https://bugzilla.mozilla.org/show_bug.cgi?id=1102219
// globalThis: https://github.com/tc39/proposal-global/blob/master/NAMING.md
Array.prototype.all = Array.prototype.every
Array.prototype.any = Array.prototype.some
Array.prototype.contains = Array.prototype.includes
Array.prototype.flatten = Array.prototype.flat
String.prototype.contains = String.prototype.includes
global = globalThis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment