Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
why does my template literal doesn't work in javascript in visual studio code

I'm beginner with java script, and I am practicing with mdn document.

the code I wrote is working differently with what is written on mdn as below.

    "use strict";

    let bigInt = 34321321321;
    console.log("value: ${bigInt}");

    let a = 5;
    let b = 10;
    console.log("fifteen is ${a+b}");

I just added script tag on index.html, which is default html file.

enter image description here

I did it on google chrome.

what could be the problem?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To use ${variable} you should use back tick ` not double qoutes "".

Back ticks use variables with ${}. If you don't use back ticks then the variable should be applied like below,

let variable = 123213;

console.log("The variable is" + variable);

If ${} is used then,

let variable = 123213;

// backticks are used without double qoutes(")
console.log(`The variable is ${variable}`);

Also there is a MDN reference.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!