Elegant FizzBuzz Example


/ Published in: JavaScript
Save to your folder(s)

When you use the `+` operator on an Array, it converts it to a string.` [].toString()` is the same as `[].join(',')`, which gives an empty string in case the array value is `undefined` or `null`. This also works in Javascript `([undefined] + "b" === "b")`.

URL: http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-Impress-Your-Friends.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.