RSRobince Studio

JavaScript Data Types

Values come in types. The ones you use most:

  • String — text in quotes: "hello"
  • Number — 42 or 3.14
  • Boolean — true or false
  • Array — a list: [1, 2, 3]
  • Object — named values: { name: "Sam" }
typeof "hello"  // "string"
typeof 42       // "number"
Try it yourself

Loading editor…