COFFEESCRIPT Questions and Answers

Explain how you can define a range array in CoffeeScript?

In two ways, you can define a range array in CoffeeScript

  • Inclusive range: This range is always defined by (. . ) operator
  • Exclusive range: This range is always defined by (. . . ) and it always omit the last value

For example, myArray = [ 1..10 ] & myArray = [ 1. . . 10 ]