Data Types

👨‍💼 JavaScript has different types of values. The three most basic types are:
  • Strings - Text wrapped in quotes: "Hello" or 'Hello'
  • Numbers - Numeric values: 42, 3.14, -7
  • Booleans - True or false values: true, false
🐨 Open and create variables for each type:
  1. Create a string variable called message with any text
  2. Create a number variable called age with a number
  3. Create a boolean variable called isLearning set to true
  4. Log each variable with its type using typeof
💰 The typeof operator tells you what type a value is:
console.log(typeof 'hello') // "string"
console.log(typeof 42) // "number"
console.log(typeof true) // "boolean"

Please set the playground first

Loading "Data Types"
Loading "Data Types"

No tests here 😢 Sorry.