Coffeescript 简明教程
CoffeeScript Tutorial
CoffeeScript 是一种对 JavaScript 进行转编译的轻量级语言。它提供了更好的语法来避免 JavaScript 的怪癖,同时保留了该语言的灵活性和美观性。
CoffeeScript is a light weight language which transcompiles into JavaScript. It provides better syntax avoiding the quirky parts of JavaScript, still retaining the flexibility and beauty of the language.
Audience
本教程是为初学者准备的,以帮助他们了解 CoffeeScript 的基本功能,以便构建动态网页和 Web 应用程序。
This tutorial has been prepared for beginners to help them understand the basic functionality of CoffeeScript to build dynamic webpages and web applications.
Prerequisites
本教程假设读者具有 HTML 编码和 JavaScript 的先验知识。如果读者有一些面向对象编程概念的先验经验,并且对创建在线应用程序有一个总体想法,那将很有帮助。
For this tutorial, it is assumed that the readers have a prior knowledge of HTML coding and JavaScript. It would help if the reader has some prior exposure to object-oriented programming concepts and a general idea on creating online applications.
Execute CoffeeScript Online
对于本教程中提供的大部分示例,您将找到 Try it 选项,因此只需利用该选项就地将 CoffeeScript 程序转译成 JavaScript 程序,享受学习的乐趣。
For most of the examples given in this tutorial, you will find Try it option, so just make use of this option to transcompile your CoffeeScript programs to JavaScript programs on the spot and enjoy your learning.
尝试以下示例,使用下面示例代码框右上角提供的 Try it 选项 −
Try the following example using the Try it option available at the top right corner of the below sample code box −
console.log "Hello Welcome to Tutorials point"