I need to produce a list objCollector with some results:
objCollector = []
allRows.each () ->
obj =
source: self.source
url: ''
host: ''
currentTag = $(this)
links = currentTag.find('a')
getTextFromSpan = currentTag.find('span.lnk').text()
extractedLink = links[0].attribs.href
obj.url = self.baseUrl + extractedLink
obj.host = getTextFromSpan
objCollector.push obj
Instead of building the result by appending to an empty list, could this be done more elegantly by using something like map
?