This file contains hidden or 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
/* | |
* Array.reducer() | |
* "The reduce() method executes a reducer function (that you provide) on each | |
* element of the array, resulting in a single output value" - MDN Docs | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | |
*/ | |
const arr = [1, 10, 4]; | |
// get the sum of all elements in the array |
This file contains hidden or 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
/** | |
* Converts Arabic numeric chars to English. | |
* @param {Number} number - The Arabic number to be converted to English number. | |
* Thanks to whomever I stole this code from on the web a while ago. | |
* Michael Scott: It's whoever, not whomever. | |
* Ryan: It's whomever. | |
* Michael Scott: No, whomever is never acutally right. | |
* Jim Halpert: Nope, sometimes it's right. | |
* Creed: Michael is right. It's a made up word used to trick students- | |
*/ |
OlderNewer