I want to split a string by comma to get an array in Node.js.
exports.test = function(rq, rs){ var mailList = \"sharan@test.com,pradeep@test.com\"; var ar
One way to do is to check whether the first value of the split array is empty or not
var arrayList = mailList.split(","); if(arrayList[0] != ""){ arrayLength = arrayList.length; }else{ arrayLength = 0; }