diff options
author | Andinus <andinus@nand.sh> | 2021-09-05 22:20:04 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-09-05 22:20:04 +0530 |
commit | ada2c83548c0c08f39e8ffee1bdd6eedc100cdc8 (patch) | |
tree | 5ec3f9d1c00f7048a3048678fba56bcc2ecf39d8 /javascript/hello-world | |
parent | b05021bb9ca6bc6f5189bfe8f2cf15e0a78fdb5e (diff) | |
download | exercism-ada2c83548c0c08f39e8ffee1bdd6eedc100cdc8.tar.gz |
JS: Raindrops: Switch to using a map
I switched to single object literals initially: const factorToSound = { 3: "Pling", 5: "Plang", 7: "Plong" }; and used `for .. if` to iterate over them, that may cause some issues: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of#difference_between_for...of_and_for...in I decided to switch to using Maps and iterate over them with `for .. of` instead.
Diffstat (limited to 'javascript/hello-world')
0 files changed, 0 insertions, 0 deletions