JSFiddle - React, Tailwind, and code Playground

by adeneo

JavaScript

var str = "[1,2,,,3,4,,,,,,5,6]";

console.log( str.split(',').map(function(x) { return x ? x : 'null' }).join(',') )