Coffeescript is a lightweight programming language used to generate a javascript compiler.
Coffeescript can be compiled into concise and efficient JavaScript to clearly see the content being compiled. It can be fully compiled into functional JavaScript without any type of Runtime Library. The syntax provided by coffeescript allows you to take full advantage of the powerful functions of JavaScript, and requires only a small runtime overhead.
Coffeescript syntax features: Unlike JS,It directly defines the block (Tab) in typographical mode without braces)
Advantages of coffeescript:
● Provides a relatively simple syntax to reduce sample code, such as parentheses and commas
● Use space as a way to organize code blocks
●Provides simple syntax for expressing Functions
● Provides class-based inheritance (optional, but useful for application development)
Syntax knowledge: Mainly compared with JS, the left is coffee, and the right is compiled Js.
1: Variable declaration and initialization
2: Condition
3: Define a function
4: objects and Arrays