+ 10
Does javascript have ` `? And for what they used?
11 Answers
+ 9
Template literals in js,
https://www.google.com/url?sa=t&source=web&rct=j&url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals&ved=2ahUKEwikmYOLwMvuAhV-xjgGHRLLA0sQFjAAegQIAhAB&usg=AOvVaw3giFP2CItvSGlocIDY3EY1&cshid=1612279220358
basically you use them to replaces variable values in a string enclosed within curly brackets
+ 9
var a = prompt("Enter Your name");
document.write(`welcome ${a}`);
+ 7
Ore doesn't work...
+ 6
That's disappointing. Go to the JavaScript course, > EcmaScript 6 > ES6 variables and strings > 3rd section
+ 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
+ 4
Look at the third section of this tutorial
https://www.sololearn.com/learning/2969/
+ 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