i am very new to JS and Jquery and i have a small difficulty understanding a certain function , I.E. i want to understand the order of execution of a very simple function that i found in the jquery documentation , look below (the example can also be found here.)::
HTML ::
<form method="post" action="">
<fieldset>
<div>
<label for="two">2</label>
<input type="checkbox" value="2" id="two" name="number[]">
</div>
<div>
<label for="four">4</label>
<input type="checkbox" value="4" id="four" name="number[]">
</div>
<div>
<label for="six">6</label>
<input type="checkbox" value="6" id="six" name="number[]">
</div>
<div>
<label for="eight">8</label>
<input type="checkbox" value="8" id="eight" name="number[]">
</div>
</fieldset>
</form>
JS ::
$( ":checkbox" )
.map(function() {
return this.id;
})
.get()
.join();
The result is ::
"two,four,six,eight".
i understand what the indivisual functions are doing above , but can somebody tell me whats the order of execution of the above script .I.E.
is map() returning indivisual id's to get() ? or is it looping over all the checkbox's and then passing all the id's at once ?