How can I skip an array element in .map?
.map
My code:
var sources = images.map(function (img) { if(img.src.split(\'.\').pop() === \"json
You can do this
var sources = []; images.map(function (img) { if(img.src.split('.').pop() !== "json"){ // if extension is not .json sources.push(img.src); // just push valid value } });