Home:ALL Converter>jquery return value what does it mean? jQuery.fn.init(3) [...,prevObject: jQuery.fn.init(1)]

jquery return value what does it mean? jQuery.fn.init(3) [...,prevObject: jQuery.fn.init(1)]

Ask Time:2020-08-24T13:41:57         Author:Siraj Samsudeen

Json Formatter

I am quite new to Jquery. I have been reading a few books, but could not understand how to interpet what I see on the console when I run a simple selector:

$("table")

I get

jQuery.fn.init(3) [table, table.table.table-bordered, table#dataTable.table.table-bordered, prevObject: jQuery.fn.init(1)]

what does fn.init mean? I could guess that the number 3 means 3 matches. What does prevObject mean and what benefit do I get from knowing that?

I looked at the similar question, but it did not answer my question. What does jquery $ actually return? I have also gone through the entire JQuery core documentation - I do know that the returned Object is a Jquery object which has a number of helpful methods. But here, I am trying to understand what is being printed on the console and how to interpret it when I am doing interactive development of Jquery for a new page in my Chrome console

Author:Siraj Samsudeen,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63555305/jquery-return-value-what-does-it-mean-jquery-fn-init3-prevobject-jquery
yy