Last active
June 13, 2019 03:26
-
-
Save markrowi/35956a79e6922a39cd8f7d22774b7fa5 to your computer and use it in GitHub Desktop.
example of recursion - Lower case all text in a object
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
| recur = (val) => { | |
| let temp = {} | |
| for(const i of Object.keys(val)) { | |
| temp[i] = typeof val[i]==='object' ? recur(val[i]) : val[i].toLowerCase(); | |
| } | |
| return temp; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment