the function each and map
by Akram kamal
HTML
<p>
foo
</p>
<p>
bar
</p>
JavaScript
$.each($("p"), function() {
console.log(this, arguments)
})
$("p").each(function() {
console.log(this, arguments)
})
$("p").map(function() {
console.log(this, arguments)
})
$.map($("p"), function() {
console.log(this, arguments)
})
$("p").toArray().map(function() {
console.log(this, arguments)
})