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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World