Coffeescript returns the last line always, all you needed to do was add a 'return null' (or just 'return') as the last line in the function.
You have to be explicit in Vanilla JS to return things or it just return null. Coffeescript explicitly returns the last line every time.
I believe that point is that JS always returns something for every object. Many users of JS just don't realize it. (I know I didn't till I started drinking the coffee flavored kool-aid)
JavaScript functions always return something, yes—but unless you have a return statement, that something is `undefined`.
wtf coffeescript. What is the point of that?
Re:Voxel.css
by matthewmacleod on Wednesday January 27, 2016 @04:50PM
(#10983766)
This is a deliberate design decision in CoffeeScript – "everything is an expression" (see http://coffeescript.org/#expressions).
This is probably as a result of CoffeeScript's Ruby-esque syntax and semantics. It does mean you can write some very clear and succinct code at times, but the tradeoff is that it can have unforeseen performance implications.
Sometimes the language is less of a good choice. E.g. i did a small toy project in coffeescript about two years ago, and found to my horror, that if your function ended in a loop, it would return an array. Always. This isn't possible to accidentally do in the host language, so I'd say it is a bad fit (for game development, where you care about such things).