I make a little secret tool. The result will be in the table, and on the left side I would like to list the numbers that I saved in $.each() . So here is my code:
$.each([1,2,3,4,5], function(i, l){ var lol = (some math stuff here); $("#output").append("<tr><td>" + l + "</td><td>" + lol + "</td><tr>"); });
What this means is the following:
1. lol1 2. lol2 3. lol3 4. lol4 5. lol5
What I'm trying to do is change the value of l , but leave everything else alone so that the result looks like this:
5. lol1 4. lol2 3. lol3 2. lol4 1. lol5
source share