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 1 of 45

    What is JavaScript?

    Where it runs, and your first line of code.

    6 minutes3 games

    Every website has 3 layers: HTML builds the structure, CSS styles and arranges it, and JavaScript makes it move and respond. When you click “Like” and the number goes up without a reload, that's JavaScript.

    JavaScript was created in 1995 to run only inside browsers. Today people write servers (Node.js), mobile apps (React Native) and desktop apps (Electron) with it, and it's the only language every browser understands with no plug-ins.

    HTML: structure

    CSS: looks

    JavaScript: behaviour

    The trio every web page is made of.

    Your first line

    console.log() prints whatever you put between the brackets to the console, the place developers read their code's results and errors. Text goes inside quotes; numbers don't.

    JavaScript
    console.log("Hello, SeaCode!")
    console.log(5 + 3)
    console.log("5 + 3")

    Press “Run”, then change the text and run again.

    Important

    In any desktop browser press F12 and open the Console tab: you can type JavaScript there and try it on any site.

    How JavaScript gets into a page

    HTML
    <!-- inside the page -->
    <script>
      console.log("Hi from the page")
    </script>
    
    <!-- or from a separate file (better) -->
    <script src="app.js" defer></script>

    defer runs the file after the page is built, so your code finds the elements it needs.

    Interview question

    What's the difference between Java and JavaScript?

    Quick question

    Which one makes a page respond when you click a button?

    What's the output?

    console.log("2 + 2")
    console.log(2 + 2)

    What will this code print?

    Exercise

    Print your name on one line, and your age in 10 years on the next (as an addition).

    JavaScript
    // Write your code here
    

    Learn more from

    • MDN: What is JavaScript?developer.mozilla.org
    • javascript.info: An Introduction to JavaScriptjavascript.info
    • MDN: console.log()developer.mozilla.org

    Played 0 of 3 games

    Sign in to save your progress and earn XP.

    NextVariables: let, const and var
    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.