I'm trying to push data in a chart from a JSON output into multiple arrays:
var STORE_A = [];
var STORE_B = [];
var STORE_C = [];
var STORE_D = [];
var STORE_E = [];
var STORE_F = [];
In order to avoid an endless amount of lines in my script, I want to use a loop. I figured out how to do my loop but I cannot use my var just before ".push".
var storeName = ("STORE_"+json[i].Store);
storeName.push(value); // Should give me STORE_A.push(value); STORE_B.push(value);...
Here is a codepen of my issue https://codepen.io/BastienAustin/pen/bBQQQz
You can see the desired output by un-commenting around line 35.
Thank you for your help.