If you want to transform the items in the array, filter isn't the right tool; map is the tool you use.
It looks like you just want to drop the middle part of the path:
var thingy = ['home/all-br/gosh1.png', 'about/ar_all/gosh.png', 'place/br-pt/noway.jpg'];
var newThing = thingy.map(function(entry) {
return entry.replace(/\/[^\/]+/, '');
});
snippet.log(JSON.stringify(newThing));
<!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 -->
<script src="//tjcrowder.github.io/simple-snippets-console/snippet.js"></script>
That uses /\/[^\/]+/, which matches a slash followed by any sequence of non-slashes, and then usese String#replace to replace that with a blank string.
If you wanted to use capture groups instead to capture the segments you wanted, you'd do much the same thing, just change what you do in the map callback, and have it return the string you want for that entry.
Just as an example of changing things slightly, here's a similar thing that captures the first and last segments and reassembles them without the part of the middle:
var thingy = ['home/all-br/gosh1.png', 'about/ar_all/gosh.png', 'place/br-pt/noway.jpg'];
var newThing = thingy.map(function(entry) {
var match = entry.match(/^([^\/]+)\/.*\/([^\/]+)$/);
return match ? match[1] + "/" + match[2] : entry;
});
snippet.log(JSON.stringify(newThing));
<!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 -->
<script src="//tjcrowder.github.io/simple-snippets-console/snippet.js"></script>
Tweak as necessary.
return result = item.match(reggy);toreturn item.match(reggy);