javascript - Get this of this -


(purely fictional!)

how can descend() return 1,2,3...?

obj = {     val: 1,     obj: {         val: 2,         obj: {             val: 3,             obj: {                 val: 4,                 descend: function() {                     return this.val;                 }             }         }     } }  obj.obj.obj.obj.descend(); 


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -