process.stdin.resume();
process.stdin.setEncoding('utf8');
let str1 = '1,2,3';
console.log(String(str1).split(','));
let str2 = '1';
console.log(String(str2).split(','));
// ⇓数値型だとエラー
let str3 = 1;
console.log(str3.split(','));
結果
[ '1', '2', '3' ]
[ '1' ]
エラー