Google News
logo
CoffeeScript - Interview Questions
What are the Strings in CoffeeScript?
Like JavaScript and many other languages, CoffeeScript supports strings as delimited by the " or ' characters. CoffeeScript also supports string interpolation within "-quoted strings, using #{ … }. Single-quoted strings are literal. You may even use interpolation in object keys.
author = "Wittgenstein"
quote  = "A picture is a fact. -- #{ author }"
​
sentence = "#{ 22 / 7 } is a decent approximation of π"
var author, quote, sentence;
​
author = "Wittgenstein";
​
quote = `A picture is a fact. -- ${author}`;
​
sentence = `${22 / 7} is a decent approximation of π`;​
Advertisement