Is there a jQuery equivalent for a Rubys Object #?

Does jQuery have the equivalent of Object # tap ?

Suppose I want to do something like this:

foo.append($("<nav>").tap(function (nav) {
  $.each(urls, function (url) {
    nav.append("<a>").attr(url).text(url)
  })
})
+5
source share
1 answer

It is called .each

nodes.each(inspect).map(mapper).each(inspect).etc()

+5
source

All Articles