0
Ola, I would like to know how to concatenate two keys of an array, the idea would be more or less like this:
dados['azul'][i] = id;
Where the Data Array has the key that is a predefined color and its second key is an i incremented with the ID value and all this within a for...
Once it enters the loop it will make a case to add the value of the element ID into the correct key. If the expected color is blue, for example, it will add a new value to the array, however several other values will be added as the loop runs.
The result would be something like this:
dados[azul]{
[2] = valordeID;
[1] = valordeID;
}
dados[preto]{
[2] = valordeID;
[1] = valordeID;
}
And so on, some suggestion?
Possible duplicate of javascript multidimensional array
– Kayo Bruno
The one marked as duplicate did not solve?
– Sam