Skip to content

Instantly share code, notes, and snippets.

@edwinwong90
Last active August 6, 2022 15:10
Show Gist options
  • Save edwinwong90/9a6a1601ef331c98b7ef54d3aff7733e to your computer and use it in GitHub Desktop.
Save edwinwong90/9a6a1601ef331c98b7ef54d3aff7733e to your computer and use it in GitHub Desktop.
Effortless print each array method result for debugging
if (!Array.prototype.print) {
// eslint-disable-next-line no-extend-native
Array.prototype.print = function () {
if (this == null) {
throw new TypeError("this is null or not defined")
}
console.log(this)
return this
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment