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

161
Vistas
Why does console.log(new Map<String, Number>([])) log true, true in JavaScript?

What exactly is causing this TypeScript-like expression to log true, true in JavaScript?

console.log(new Map<String, Number>([]))

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you format it differently, you can see that this might look like TS, but it's just JavaScript. Coincidentally, the angle brackets and the comma match perfectly with the syntax for the two arguments of console.log, where each is a comparison, less than and greater than. What is being compared is:

new Map < String // true
Number > [] // true

Written out in a way that makes this more obvious:

console.log(new Map < String, Number > ([]))

If you meant to write this in a TS file where it might get interpreted (as you may have intended) as a type generic, then you are probably looking for different types: string and number, rather than the String and Number constructors that you used in the example.

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