Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Forked from rwaldron/subject-is-dead.js
Created November 22, 2011 19:03
Show Gist options
  • Save jugglinmike/1386567 to your computer and use it in GitHub Desktop.
Save jugglinmike/1386567 to your computer and use it in GitHub Desktop.
var subject = "[Subject] is dead, long live [Subject]",
regex = /\[Subject\]/g;
while( regex.test(subject) ) {
subject = subject.replace( regex, subject );
console.log( subject );
}
// Warning... I killed node with this.
// FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of memory
// Crash shot: http://gyazo.com/33c14277400807f210547943d46b5046.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment