carrieks
carrieks

Reputation: 87

using console.table() with jQuery array -- how to not include "extra" jquery properties

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

Upvotes: 1

Views: 830

Answers (1)

feeela
feeela

Reputation: 29932

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/

Upvotes: 2

Related Questions