Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

186
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda