JavaScript Tutorials – Learn JavaScript from Basics to Advanced
JavaScript is what makes web pages interactive. These guides focus on the fundamentals: how to run and debug code, work with variables and data types, manipulate strings, and manage arrays. Each article covers one technique with practical examples you can use right away.
Getting Started
Everything you need to write and run your first JavaScript: where the code goes, how to execute it, and how to troubleshoot when things don't work as expected.
Learn JavaScript on Mimo
- How to Link JavaScript to HTML
- How to Run JavaScript
- How to Comment in JavaScript
- How to Print in JavaScript
- How to Debug JavaScript
Variables and Data Types
Variables are where JavaScript stores information, and data types determine what kind of information that is. These guides cover declaring variables and working with the type system.
- How to Declare a Variable in JavaScript
- How to Check Data Type in JavaScript
- How to Convert to String in JavaScript
- How to Convert to a Number in JavaScript
- How to Convert to an Array in JavaScript
Strings
Strings are one of the most-used data types in JavaScript. These guides cover the operations you'll reach for constantly — joining, slicing, replacing, casing, and cleaning up text.
- How to Concatenate Strings in JavaScript
- How to Split a String in JavaScript
- How to Replace Text in JavaScript
- How to Change String Case in JavaScript
- How to Trim Whitespace in JavaScript
Arrays
Arrays let you store and work with lists of data. These guides walk through creating arrays, adding and removing items, and iterating over them with loops and higher-order methods.
- How to Create an Array in JavaScript
- How to Add to an Array in JavaScript
- How to Remove from an Array in JavaScript
- How to Loop Through an Array in JavaScript
- How to Get Array Length in JavaScript
- How to Sort an Array in JavaScript
- How to Filter an Array in JavaScript
- How to Use Map in JavaScript
Functions
Functions are how JavaScript organizes and reuses logic. These guides cover the different ways to define them, how to pass and return data, and the patterns — like callbacks and arrow functions — that show up constantly in real code.
- How to Create a Function in JavaScript
- How to Use Parameters in JavaScript
- How to Return a Value in JavaScript
- How to Use Arrow Functions in JavaScript
- How to Use Callback Functions in JavaScript
- How to Use 'this' in JavaScript
Objects
Objects store structured data as key-value pairs and are central to how JavaScript works. These guides cover creating them, modifying their properties, and iterating over their contents.
- How to Create an Object in JavaScript
- How to Add/Remove Object Properties in JavaScript
- How to Loop Through an Object in JavaScript
Control Flow
How JavaScript decides what to execute and when to stop. These guides cover conditionals, loops, error handling, and the statements that interrupt execution mid-flow.
- How to Write an If Statement in JavaScript
- How to Use Switch Statements in JavaScript
- How to Write a For Loop in JavaScript
- How to Use a While Loop in JavaScript
- How to Use Break and Continue in JavaScript
- How to Use Try Catch in JavaScript
The DOM
The DOM is how JavaScript reads and changes what's on the page. These guides cover selecting elements, updating content and styles, and creating or removing nodes dynamically.
- How to Select an Element in JavaScript
- How to Change HTML Content in JavaScript
- How to Change CSS with JavaScript
- How to Change Image Source in JavaScript
- How to Create an Element in JavaScript
- How to Remove an Element in JavaScript
- How to Add a Class in JavaScript
- How to Remove a Class in JavaScript
Events
JavaScript responds to user interaction through events. These guides cover the listener pattern and the specific event types you'll handle most often.
- How to Add an Event Listener in JavaScript
- How to Handle Click Events in JavaScript
- How to Handle Mouse Events in JavaScript
- How to Handle Keyboard Events in JavaScript
- How to Handle Input Events in JavaScript
- How to Handle Form Submit in JavaScript
Forms & Browser APIs
Working with user input, page navigation, and the native browser dialogs that don't require any external libraries.
- How to Get Input Value in JavaScript
- How to Clear Input Field in JavaScript
- How to Validate a Form in JavaScript
- How to Use Alert/Prompt/Confirm in JavaScript
- How to Scroll in JavaScript
- How to Redirect in JavaScript
- How to Reload Page in JavaScript
Dates & Numbers
Formatting dates, doing math, and generating random values — the standard library methods JavaScript gives you for working with time and numbers.
- How to Get Current Date in JavaScript
- How to Format Date in JavaScript
- How to Use Math.abs in JavaScript
- How to Round Numbers in JavaScript
- How to Generate Random Numbers in JavaScript
Async & Data
How JavaScript handles operations that take time, communicates with APIs, and works with JSON as the standard data exchange format.
Join 35M+ people learning for free on Mimo
4.8 out of 5 across 1M+ reviews
Check us out on Apple AppStore, Google Play Store, and Trustpilot