Code
jquery
// Iterate over a collection
$("li").each(function (i) {
console.log(i, $(this).text());
});
// Map to a new array
const texts = $("li").map(function () {
return $(this).text();
}).get();
// Merge objects
const defaults = { limit: 10, page: 1 };
const opts = $.extend({}, defaults, { limit: 20 });
console.log(opts); // { limit: 20, page: 1 }
// Array helpers
$.grep([1, 2, 3], n => n > 1); // [2, 3]
$.inArray(2, [1, 2, 3]); // 1
$.isArray([]); // true
$.trim(" hi "); // "hi"