I write more Ruby than JavaScript. In Ruby, every expression returns an object, so explicit return statements are rarely used. In JavaScript, I always forget to explicitly return something from a function.
This by itself isn't really confusing, but then I get confused between:
returnsomething()
and:
returnfunction(){something()}
Something about the scoping of function calls still hasn't clicked for me yet in JS, so I always end up trying a variety of return statements until the code executes as intended. This would probably all make perfect sense if I wrote JS more often, but as an occasional dabbler this is what eats up my time.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Return statements.
I write more Ruby than JavaScript. In Ruby, every expression returns an object, so explicit return statements are rarely used. In JavaScript, I always forget to explicitly return something from a function.
This by itself isn't really confusing, but then I get confused between:
and:
Something about the scoping of function calls still hasn't clicked for me yet in JS, so I always end up trying a variety of return statements until the code executes as intended. This would probably all make perfect sense if I wrote JS more often, but as an occasional dabbler this is what eats up my time.