Ver originalvar data = ['ciries','restaurants','dogs','cats']; var obj = {}; var canti = data.length; for(var i =0; i<canti; i++){ obj[data[i]] = new L.LayerGroup(); };