The Coffeescript docs contain the following blurb
String Interpolation, Block Strings, and Block Comments
Ruby-style string interpolation is included in CoffeeScript. Double-quoted strings allow for interpolated values, using #{ … }, and single-quoted strings are literal.
Can someone explain what “single-quoted strings are literal” means here?
Does it just mean that there will be no interpretation? Is there a more javascripty meaning?
I ask because I was seeing a difference when using a single quoted string vs a double quoted as a object key.
Literal in this case means that it is literally what you wrote in the string
For this reason (and a few others) I like to use a convention of double quotes when the string is natural language that is meaningful to an end user (for example an error message). And single quotes for symbols that are meaningful to the program (like property names, flags, module names, etc).
And no, that’s not your fault, the word ‘literal’ has like 20 definitions in cs.