+ 10

Does javascript have ` `? And for what they used?

2nd Feb 2021, 3:18 PM
Սոֆի
11 Respuestas
+ 9
var a = prompt("Enter Your name"); document.write(`welcome ${a}`);
2nd Feb 2021, 3:35 PM
TOLUENE
TOLUENE - avatar
+ 7
Ore doesn't work...
2nd Feb 2021, 3:58 PM
Սոֆի
+ 6
That's disappointing. Go to the JavaScript course, > EcmaScript 6 > ES6 variables and strings > 3rd section
2nd Feb 2021, 3:59 PM
Ore
Ore - avatar
+ 5
They are called Template literals, they are enclosed in back ticks( ` `) they can contain placeholders, wich are indicated by the dollar sign and curly braces ${expression}. In my opinion its much simpler to use template litterals than to use single or double quotes, expecially when writing multi lines string and for string interpolation! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
4th Feb 2021, 12:25 AM
Helder Balbino
Helder Balbino - avatar
+ 4
Look at the third section of this tutorial https://www.sololearn.com/learning/2969/
2nd Feb 2021, 3:42 PM
Ore
Ore - avatar
+ 4
$♡F!💗 I see. I got that link from the 'share' option in the app. You can view it in the website here. https://www.sololearn.com/learning/1024/2969/6464/1
2nd Feb 2021, 3:56 PM
Ore
Ore - avatar