'create a unique variable from a string inside loop [duplicate]
I am trying to use a key (unique number) and add a letter to that key (cause you cant just do var 230 = []). so I can push the right value to the right array. How can I do that??? ):
const keys = [230, 330]
let a230 = []
let a330 = []
keys.forEach((key, value) => {
a[key].push(value) //push value to a230...
}
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
