is programming language, which is built on top of JavaScript
. CoffeeScript compiles into JavaScript that is efficient and consistent with many best practices. And it offers a clean syntax that should appeal to anyone who likes Python
or Ruby
.
Actually, The CoffeeScript
is just a JavaScript. So you can use any exsiting JavaScript library seamlessly from CoffeeScript. And both clientside
and serverside
can be written by CoffeeScript
. So CoffeeScript can write entire web application completely, not like JavaScript only write clientside.
The CoffeeScript is a Node.js
package, so you need to install it with Node Package Manager
. There assume you have installed node.js. You can watch here to see how to install node.js if you dont’ know it. Putting below commands to install CoffeeScript:
1


CoffeeScript supports many commands to let you build your application. You just need to input below command line:
1


It will print awesome useful content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 

Let’s give a example, how to use CoffeeScript to solve a mathematics problem. Here we will solve the first mathematical problem of Project Eluar
. The problem is below:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
And now we solve this problem with CoffeeScript elegantly:
1


You see, just one code line. It’s very concise and elegant. Not like JavaScript need to defined many variables and functions to solve it.
Cheers, I think you will love it.