
coffeescript icon
Coffee-script is a smoking hot simple language that converts 100% into Javascript code. Coffee-script allows you to spend more time focusing on the algorithm rather than the syntax.
js2coffee.org is an awesome website that converts your Coffee-script to Javascript and vice versa on the fly. So you can learn Coffee-script faster.
Example:
Let’s convert my Random Number Generator code from a previous post to Coffee-script.
// Javascript version
var getRandomNum = function( i, decLen ){
return (Math.random() * (i||1) ).toFixed(decLen);
};
# My Coffee-script version getRandomNum = ( i=1, decLen ) -> (Math.random()*i).toFixed(decLen) |
# js2coffee.org Coffee-script verison getRandomNum = (i, decLen) -> (Math.random() * (i or 1)).toFixed decLen |
Awesome huh?
Check out a demo of Coffeescript here.
I’ll like to leave you with a HTML5 Coffee-script presentation.
(Page view Count: 101)