Search posts, tags, users, and pages
Get a better understanding of the "this" keyword in Javascript
Neha Bharati
@nehabharati
Web Developer
Markdown supported · ⌘↵ to post
cedric simon
In your second sample, the grow method, shouldn't it be declared like grow:function()? Maybe it's a syntax I am not aware of...
grow
grow:function()
Yes that's the shorthand for declaring a method. You can define it either way.
cedric simon
In your second sample, the
growmethod, shouldn't it be declared likegrow:function()? Maybe it's a syntax I am not aware of...