summary refs log tree commit diff stats
path: root/go
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-05 22:20:04 +0530
committerAndinus <andinus@nand.sh>2021-09-05 22:20:04 +0530
commitada2c83548c0c08f39e8ffee1bdd6eedc100cdc8 (patch)
tree5ec3f9d1c00f7048a3048678fba56bcc2ecf39d8 /go
parentb05021bb9ca6bc6f5189bfe8f2cf15e0a78fdb5e (diff)
downloadexercism-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 'go')
0 files changed, 0 insertions, 0 deletions