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?

truncated output of console.table

¿Fue útil?

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") )

See: http://api.jquery.com/jquery.makearray/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top