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

114
Views
How do i output a javascript template literal to the console
var variable = 2;

var x = `${variable}`;
console.log(x) to output `${variable}`

not 2 thank you. am new to programming

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

0

You can escape the backticks:

var variable = 2;

var x = `\`${variable}\``;
console.log(x)

about 4 years ago · Juan Pablo Isaza Report

0

Welcome to Programming. Depending on the overall goal here, I would maybe set another variable, say y to the string of the template literal.

var y = '`${variable}`'

Unfortunately, Javascript will always evaluate the value stored in a variable storing a primitive data type like a string or number.

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!