How can I skip an array element in `.map`?

My code:

```
var sources = images.map(function (img) {
    if(img.src.split('.').pop() === "json"){ // if extension is .json
        return null; // skip
    }
    else{
        return img.src;
    }
});

```

This will return:

```
["img.png", null, "img.png"]

```