Coffeescript (1)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.