Hello All, Although as you said this list is not meant for question/answers, you explained it. Thanks for the explanation. This is my first and last question in this list as per the list standards. I would still say if there is another list for question/answers the community will be much more helpful than earlier.
Again thanks to everyone. > On Jan 2, 2016, at 10:18 AM, Garrett Smith <[email protected]> wrote: > > Because javascript is dynamically typed, conversion from objects to > primitive values and vice versa. This is done respectively by the > internal [[ToPrimitive]] and [[ToObject]] methods. See > Object.prototype.toString, step 3 > > | Let O be ToObject(this value). > > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject > > ToObject, creates a String object whose value is that of the passed-in string: > > Thank you, > > On Fri, Jan 1, 2016 at 9:24 AM, Arup Rakshit <[email protected]> wrote: >> Hi, >> >> Consider the below simple code : >> >> 'k' instanceof String; // false >> new String('k') instanceof String; // true >> >> Now, When I am inspecting them as below why in both cases the output comes >> as [object String] ? >> >> The below is understood as per the result of the `instanceof` operator. >> >> Object.prototype.toString.call( new String('k') ); // "[object String]” >> >> My confusion comes when I see the below code output : >> >> Object.prototype.toString.call( 'k' ); // "[object String]” >> >> Can anyone please explain it ? >> _______________________________________________ >> es-discuss mailing list >> [email protected] >> https://mail.mozilla.org/listinfo/es-discuss > > > > -- > Garrett > @xkit > ChordCycles.wordpress.com > garretts.github.io > personx.tumblr.com _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

