using console.table() with jQuery array — how to not include “extra” jquery properties
-
20-12-2019 - |
Pregunta
i want to console.table() a jquery array like this:
console.table($("input").filter(":hidden"), ["name", "value"]);
however, the table includes all those extra jquery properties that come along for the ride. is there a "correct" way to not output these extra properties to the table, or should i just populate a new array with (in this example) indices 0-8 and output that?
Solución
jQuery has a makeArray
function that looks promising.
It should return a JS array with all the elements from the original object:
jQuery.makeArray( $("input").filter(":hidden") )
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow