Ans: CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way
Ans: CoffeeScript has been inspired by Python, Ruby and Haskell, it adopted syntax & coding styles from them, which makes it very unique & Useful.
Ans: You have to add semicolon at the end of statements to execute variables in JavaScript while in CoffeeScript there is no need to add Semi-colon at the end of the statement.
There are numerous advantages over JavaScript, some of them are :
Ans:
Purpose of CoffeeScript is to remove all the rough edges from JavaScript and provides a smooth way of programming in JavaScript.
Ans: For variables in JavaScript, you have to add semi-colon at the end of it to execute while in CoffeeScript there is no need to add Semi-colon at the end of the statement. Unlike, JavaScript, CoffeeScript adds up semi-colon with ease.
Ans: Functions in CoffeeScript is an (Optional) list of parameters followed by an arrow and then the function body.
For example, log = (message) à console.log message
Ans: CoffeeScript compiler ensures that within the lexical scope, all your variables are properly declared, and you never need to write “var” yourself
Ans: Clone function is useful in creating a complete new object in Coffee Script by:
Ans: CoffeeScript is the 11th most popular language in Github. Its main purpose is to produce efficient JavaScript without writing much code. It also focuses on highlighting all the good aspects of JavaScript with simple syntax.
Ans: The main difference between copying an object through assignment and clone-function is that how they handle references. The assignment only copies the reference of the object while clone-function creates a complete new object.
Ans: The concept of Interpolation in CoffeeScript is same as Ruby. Most expressions of CoffeeScript are valid inside the #{...} interpolation syntax.
Ans: In CoffeeScript is same as other but instead of "True" or "False". In CoffeeScript, "True" is generally represented as "On" or "Yes" and "False" is represented as "Off" or "No
Ans: Coffee script has clean support for anonymous functions, to map an array in object use map() with an anonymous function. For simple mapping, list comprehension is more useful as Coffee script directly support list comprehensions.
Ans: Yes, CoffeeScript allows to bind parameters to properties by using the @ shorthand, this also allows you to define class functions.