Rizki
asked

Expert
Abhay Jajodia answered
Hi Rizki,
Normal quotes (" " or ' ') make a basic string. Template literals use backticks ) and give you two big benefits:
Easy variables inside the string using
${}
let name = "Ali";
console.log(`Hello ${name}`);
With normal quotes you usually do:
console.log("Hello " + name);
Multi-line strings without adding
\n
console.log(`Line 1
Line 2`);
So template literals are mainly for cleaner formatting and easier mixing of text + variables.
If you have more questions, I am here to help 😊
JS
This question was asked as part of the Learn JavaScript Basics course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer