Data Types in JavaScript

VariablesConversión de Tipos

Every value in JavaScript has a data type. Understanding types is essential for writing correct and predictable code.

JavaScript has two main categories: primitive types (immutable basic values) and objects (complex, mutable data).

Primitive Types

There are seven primitive data types:

  • String – text values
  • Number – integers and floating-point numbers
  • Boolean – true or false
  • Undefined – variable declared but not assigned
  • Null – intentional absence of value
  • Symbol – unique identifiers (ES6)
  • BigInt – arbitrary-precision integers (ES2020)

String

Number

JavaScript has one number type for both integers and floats.

Boolean

Undefined and Null

Symbol and BigInt

Objects

Everything else (arrays, functions, dates, etc.) is an object.

Checking Types with typeof

Quick Quiz

Hemos revisado y comprobado los materiales, pero aún pueden existir errores. El contenido se ofrece únicamente con fines educativos, así que úsalo bajo tu propia responsabilidad y verifica con otras fuentes si es necesario.

✨ Pregunta a Lara — tu compañera de estudio con IA

Desbloquea soporte de aprendizaje personalizado. Lara puede explicar lecciones, resumir temas y responder tus preguntas — disponible desde el plan Go y superiores.


Lara te ayuda a aprender más rápido — exclusivo para los miembros ReadyTools Go, Plus y Max.

Sigue Tu Progreso 🚀

Aprende más fácilmente siguiendo tu progreso completamente gratis.