===: Yeah, I just picked up this habit, as it is usually the safer option, especially when processing external/user input.
return: JS is one of the langs without implicit returns. Nevertheless in the middle of a function we need to be explicit anyway, since more code follows afterwards. If implicit returns were supported you could use an else block to avoid a keyword, but also not worth the effort.
Yeah I was hoping es6 is closer to functional than this. The only way to get an implicit return from the last expression is a lambda function without brackets (containing a single expression).
let fun = () => 0;
fun() // will return 0
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.
===
: Yeah, I just picked up this habit, as it is usually the safer option, especially when processing external/user input.return
: JS is one of the langs without implicit returns. Nevertheless in the middle of a function we need to be explicit anyway, since more code follows afterwards. If implicit returns were supported you could use an else block to avoid a keyword, but also not worth the effort.Yeah I was hoping es6 is closer to functional than this. The only way to get an implicit return from the last expression is a lambda function without brackets (containing a single expression).