I\'m using Array.prototype.map.call to store in an array a bunch of node list objects:
function getListings() {
return Array.prototype.map.call(document.
The MDN documentation says:
callback is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.
So
function getListings() {
return Array.prototype.map.call(document.querySelectorAll('li.g'), function(e, rank) { // magic
return {
rectangle: e.getBoundingClientRect(),
rank: rank // <-- magic happens
}
}
}