Frage im Vorstellungsgespräch bei Fonality

How would you iterate through an array using JQuery. Find all elements with the class name "tip" using jQuery. Filter all even div elements using JQuery

Antwort im Vorstellungsgespräch

Anonym

29. Aug. 2016

1. var array = [1,2,3,4,5,6]; $.each(array, function(){ console.log(this); }); 2. var tips = $('.tip'); 3. var evenDivs = $('div').filter(function(index){ return index % 2 == 0; });