Here is an example of CoffeeScript:
There are still other good things of CoffeeScript. For instance, CoffeeScript warp the function by default to avoid global variable space contamination.
The above example will be compiled into:
Another feature of CoffeeScript is block regular expression, which supports better regex code. This is a regex pattern checking domain name in CoffeeScript:
Node.js libraries are supported as well. Let’s see a hello-world Express.js example written in CoffeeScript:
If you want to give CoffeeScript a try, you can download
coffee-script as a Node.js app and install it globally.
Alternatively, you can try some CoffeeScript snippet on the CoffeeScript website. (At Try CoffeeScript region.)