In this section, we will look at the various aspects of working with strings or text-based data.
In this section, we will demonstrate the CoffeeScript feature of string interpolation.
var lineCount = countLinesInFile('application.log'); var message = "The file has a total of " + lineCount + " lines"; console.log(message);
This can get pretty messy and CoffeeScript provides an elegant solution to avoid this called string interpolation.
CoffeeScript provides the ability to perform string interpolation by using double quoted strings containing ...