#Quick question !

11 messages · Page 1 of 1 (latest)

bleak socket
#

Why is the output NaN if it seems like its a number + number ? Theres no conflict in redeclaration or adding the same key so i wonder why ?

spring gulch
#

this.x is not a number

bleak socket
#

so what is this considered as ?

spring gulch
#

undefined

bleak socket
#

output : 5

spring gulch
#

right. it's defined when you call .toString()

#

not when you add 5

bleak socket
#

alr so this .toString() takes it from lexical range of obj1 ?

spring gulch
#

you can't use a property during declaration. this.x would be undefined until after obj1 is fully declared/assigned

bleak socket
#

yup i got that