Created
December 5, 2015 12:09
-
-
Save mieszko4/854c8583ff0157ce00a7 to your computer and use it in GitHub Desktop.
If ABCDEFGHIJKLMNOPQRSTUVWXYZ equals 1234567891011121314151617181920212223242526 then...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['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