So I have a javascript variable that looks like this
D,CPU_Purchased_ghz,2015-03-19 00:00:00,10.00,2015-03-20 00:00:00,10.00
Is it possible to split into an array like this:
[
[D,CPU_Purchased_ghz],
[2015-03-19 00:00:00,10.00],
[2015-03-20 00:00:00,10.00]
]
ie. I want to be able to split it into blocks of 2
split
function can almost do it - but how do you differentiate whether a comma starts a new element, or just appends some new parts? You have to write your own logic for that. – doldt Mar 27 at 12:18