ho una lunga stringa, che costruisco con ES6 stringhe di modello, ma voglio che sia privo di interruzioni di riga:Stringhe modello ES6 prevenire interruzioni di riga
var string = `As all string substitutions in Template Strings are JavaScript
expressions, we can substitute a lot more than variable names.
For example, below we can use expression interpolation to
embed for some readable inline math:`
console.log(string);
Risultato:
As all string substitutions in Template Strings are JavaScript
expressions, we can substitute a lot more than variable names.
For example, below we can use expression interpolation to
embed for some readable inline math:
mio aspettativa:
As all string substitutions in Template Strings are JavaScript expressions, we can substitute a lot more than variable names. For example, below we can use expression interpolation to embed for some readable inline math:
sfugge l'interruzione di riga con una barra '\\' e scomparirà nell'output, anche nelle stringhe di template. – dandavis