Can the data type of each field be preserved in Javascript after splitting it using the split method?
Input:
var row = "128, 'FirstName, LastName', null, true, false, null, 'CityName'";
When using the split method, the data type of each field is lost and results in an array of strings as shown below.
row.split(',');
["128", " 'FirstName", " LastName'", " null", " true", " false", " null", " 'CityName'"]
Even a comprehensive CSV to Array function like the one I found here also gave the same array of strings output.
Any recommendations for preserving data types while splitting the data?