I am pulling an input elements array from the DOM using the the id and using .map() to loop through the array. My code works, however currentValue and index are switched:
ports = $("#edit_display_control_ports > li > input").map(function(currentValue, index){
return index.value;}
).toArray();
Again, this code works. According to documentation, the first parameter of the map() function should be the currentValue and the second, index. However I have to switch the two. The currentValue return the index of the array, while the index parameter returns the element.