Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    JSJavaScript

    Getting started

    • What is JavaScript?
    • Variables: let, const and var
    • Data types
    • Type conversion

    Operators and strings

    • Arithmetic and assignment
    • Comparison and logic
    • Strings and template literals
    • String methods
    • Numbers and Math

    Control flow

    • Conditions: if and else
    • switch and the ternary operator
    • Loops: for and while
    • Challenge: FizzBuzz

    Functions

    • Functions
    • Arrow functions
    • Parameters: default, rest and spread
    • Scope and closures
    • Callbacks and higher-order functions

    Arrays

    • Array basics
    • map, filter and find
    • reduce and sorting
    • Destructuring

    Objects

    • Object basics
    • Copies and references
    • Methods and this
    • JSON and optional chaining

    Classes and OOP

    • Classes
    • Inheritance

    JavaScript in the page

    • Controlling the page (DOM)
    • Creating elements
    • Events
    • Forms and validation
    • Saving in the browser (localStorage)

    Errors and async

    • Handling errors: try and catch
    • Timers and the event loop
    • Promises
    • async and await
    • Fetching data from an API

    Practical tools and techniques

    • Searching with regular expressions
    • Cancellation and stale results
    • Testing and debugging JavaScript

    Modern JavaScript and a project

    • Map and Set
    • Dates and localised formatting
    • Modules: import and export
    • Project: a complete to-do app
    JavaScript

    Getting started · Lesson 3 of 45

    Data types

    The 8 types, and how to tell a value's type.

    8 minutes4 games

    Every value has a type. There are 7 simple types (primitives) and one complex one:

    • string: text, "hello".
    • number: whole or decimal, 42, 3.5.
    • boolean: true or false.
    • undefined: a variable with no value yet.
    • null: “no value” on purpose.
    • bigint: huge whole numbers, 9007199254740993n.
    • symbol: a unique value, rarely needed.
    • object: anything composite: objects, arrays and functions.
    JavaScript
    console.log(typeof "SeaCode")
    console.log(typeof 2026)
    console.log(typeof true)
    let nothing
    console.log(typeof nothing)
    console.log(typeof [1, 2])
    console.log(typeof null)

    Important

    typeof null returns "object". It's a bug from JavaScript's first version, kept so old sites don't break. Check for null with value === null, and for arrays use Array.isArray(x).

    "5" is text and 5 a number. "5" + 1 gives "51" because adding to text joins them.

    Interview question

    What's the difference between null and undefined?

    What's the output?

    console.log("5" + 1)
    console.log(5 + 1)

    What will this code print?

    Quick question

    What does typeof false return?

    Order the lines

    Order the lines so the code prints number.

    1. Click the lines in the right order

    Exercise

    Print the type of 3.14.

    Expected output: number

    JavaScript

    Learn more from

    • javascript.info: Data typesjavascript.info
    • MDN: JavaScript data typesdeveloper.mozilla.org
    • MDN: typeofdeveloper.mozilla.org

    Played 0 of 4 games

    Sign in to save your progress and earn XP.

    PreviousVariables: let, const and varNextType conversion
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.