Skip to content

Instantly share code, notes, and snippets.

@joshleaves
Created July 22, 2013 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshleaves/6058597 to your computer and use it in GitHub Desktop.
Save joshleaves/6058597 to your computer and use it in GitHub Desktop.
My entry for @addyosmani's "Make lyrics with javascript" entry :)
var jude = 'jude';
var yeah = 'yeah';
var hey = 'hey';
var sixjude = [ jude, jude, jude, jude, jude, jude ];
var sixyeah = [ yeah, yeah, yeah, yeah, yeah, yeah ];
console.log(yeah);
console.log(sixjude.map(parseInt).join() + '(' + sixyeah.join() + ')');
console.log(sixjude.map(parseInt).join() + hey + jude);
console.log();
console.log(sixjude.map(parseInt).join());
console.log(sixjude.map(parseInt).join() + hey + jude);
console.log();
console.log(sixjude.map(parseInt).join());
console.log(sixjude.map(parseInt).join() + hey + jude);
var i = 0;
console.log(sixjude.map(function (x) { if (i == 0) return x; return x.replace('e', 'y'); }).join());
console.log('Ow! Wow!');
console.log();
console.log(yeah + ', you know you can make it, ' + jude);
console.log(jude + ', youre not gonna break it');
yeah
NaN,NaN,NaN,NaN,NaN,NaN(yeah,yeah,yeah,yeah,yeah,yeah)
NaN,NaN,NaN,NaN,NaN,NaNheyjude
NaN,NaN,NaN,NaN,NaN,NaN
NaN,NaN,NaN,NaN,NaN,NaNheyjude
NaN,NaN,NaN,NaN,NaN,NaN
NaN,NaN,NaN,NaN,NaN,NaNheyjude
jude,jude,jude,jude,jude,jude
Ow! Wow!
yeah, you know you can make it, jude
jude, youre not gonna break it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment