In Javascript, is it possible to preserve data type of each data field after splitting it using split method?
Input:
var row = "128, 'FirstName, LastName', null, true, false, null, 'CityName'";
On splitting using split method, the data type of each field is lost. The result is an array of strings as given below.
row.split(',');
["128", " 'FirstName", " LastName'", " null", " true", " false", " null", " 'CityName'"]
A robust CSV to Array function like the one I found here: CSVtoArray also returned the same array of strings output.
Any suggestions?