To perform Array functions like map, filter on a HTMLCollection you will need to convert it to an Array first. Here's how to do it easily in Javascript.
var collection = document.getElementsByTagName("div"),
arr;
// long version
arr = Array.prototype.slice.call(collection);
// short version
arr = [].slice.call(collection);
// ES6 version
arr = [...collection]