Skip to content

Instantly share code, notes, and snippets.

@mieszko4
Created December 5, 2015 12:09
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 mieszko4/854c8583ff0157ce00a7 to your computer and use it in GitHub Desktop.
Save mieszko4/854c8583ff0157ce00a7 to your computer and use it in GitHub Desktop.
If ABCDEFGHIJKLMNOPQRSTUVWXYZ equals 1234567891011121314151617181920212223242526 then...
['Knowledge', 'Hardwork', 'Attitude'].map(function (word) {
return {
word: word,
count: word.toUpperCase().split('').reduce(function (p, c) {
return p + (c.charCodeAt(0)-'A'.charCodeAt(0) + 1);
}, 0)
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment