I was processing some data and I have filtered the data to a point where I have stored the data which should be the keys of the JSON file I want to create into an array like this
[
'A',
'B',
'C',
'D',
'E'
]
Now I want to set these array values as keys dynamically to create a JSON with other data
Oh this is specific to the data I have. My data includes an array full of strings but some of the data are ‘1’, ‘2’ etc…
So I wanted to split the data at that point so I put it like that for testing
I saw that if we multiply a string with a number we would get NaN unless the string contains the number so I thought this check would be a good point to split the data
Please post what keys looks like, since you have explained that arrdata looks like in the last post. It is always better to post as much code as possible, so we can test things for ourselves. Currently, your for loop is missing a }. Also, what do you do with row later in the code?
Instead of relying upon implicit conversion, try using explicit conversion. Googling something like ‘convert string to number, JavaScript’ is where I’d start - I never remember exact function names.