Monday 15 September 2014

jquery - Javascript - [object Object] means? -



jquery - Javascript - [object Object] means? -

one of alert giving above result [object object] mean? alert of object of jquery type.

it means alerting instance of object. when alerting object, tostring() called on object, , default implementation returns [object object].

var obja = {}; var objb = new object; var objc = {}; objc.tostring = function () { homecoming "objc" }; alert(obja); // [object object] alert(objb); // [object object] alert(objc); // objc

if want inspect object, should either console.log it, json.stringify() it, or enumerate on it's properties , inspect them individually using for in.

javascript jquery

No comments:

Post a Comment