Skip to content

Instantly share code, notes, and snippets.

@kirkouimet
Created May 17, 2013 03:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkouimet/5596828 to your computer and use it in GitHub Desktop.
Save kirkouimet/5596828 to your computer and use it in GitHub Desktop.
Add baconify method to the string class
String.prototype.baconify = function() {
return this.replace(/({|})/gi, 'BACON');
}
'{"jsonKey":"jsonValue"}'.baconify();
//"BACON"jsonKey":"jsonValue"BACON"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment