Skip to content

Instantly share code, notes, and snippets.

@adamjspooner
Created January 23, 2012 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamjspooner/1665152 to your computer and use it in GitHub Desktop.
Save adamjspooner/1665152 to your computer and use it in GitHub Desktop.
Duck punching JavaScript's Number for toString() typos.
Number.prototype.yoString = function() {
return 'Yo, ' + this + '!';
};
var num = 3;
console.log(num.yoString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment