Build a practical foundation in JavaScript and start creating browser-based programs from your own files. This beginner course guides you from a clean Node.js setup and first console output to an interactive web application built in vanilla JavaScript.

Introduction to JavaScript for Beginners
Ends soon! Get $70+ in savings and build skills with Coursera Plus. Save 40% for 3 months.

Introduction to JavaScript for Beginners

Instructor: Anton Voroniuk
Top Instructor
Included with •Learn more
Recommended experience
Recommended experience
What you'll learn
Build and run JavaScript programs in the browser, HTML pages, and Node.js while debugging type-related errors.
Create and submit a vanilla JavaScript to-do app that renders, updates, completes, and deletes tasks with DOM events.
Details to know

Add to your LinkedIn profile
September 2026
3 assignments
See how employees at top companies are mastering in-demand skills

There are 8 modules in this course
Wondering how to install Node.js and run your first JavaScript file without breaking your computer? This module answers exactly that question. By the end of this module you will run the same JavaScript program in three places: the browser console, an HTML page, and Node.js. You'll install Node.js and a code editor, write and save a .js file, print results with console.log, and collect input with prompt and readline, so you always know where your code lives and how to execute it. This module is designed for absolute beginners who have never installed a programming tool, and for professionals moving into web development who want a clean modern setup on the first attempt. No coding experience is required and no paid software is required, and every tool runs free on Windows, macOS, and Linux. Along the way you'll see why JavaScript runs in both the browser and the server, what a JavaScript runtime does with your file, and how to verify your installation before writing real code. You'll finish with a working JavaScript environment and a first script saved on your machine, ready to reuse for every exercise, tutorial, or job task that follows.
What's included
4 videos1 reading1 ungraded lab
4 videos•Total 8 minutes
- Why Learn JavaScript? Opportunities and Use Cases•3 minutes
- Setting Up Node.js and Your Code Editor•4 minutes
- Running Your First Script in the Browser and in Node.js•1 minute
- Printing Output with console.log and Reading Input with prompt•1 minute
1 reading•Total 10 minutes
- Where JavaScript Lives: Browser, File, and Server•10 minutes
1 ungraded lab•Total 30 minutes
- Run One Script Three Ways•30 minutes
Wondering how to store values in JavaScript without hitting ""undefined is not a function"" every five minutes? This module answers exactly that question. By the end of this module you will declare variables correctly with let and const and diagnose a type-related bug from the error message alone. You'll compare let, const, and var, work with the core data types — string, number, boolean, null, undefined, object, symbol — read a stack trace in the browser DevTools console, and step through code with breakpoints in VS Code or WebStorm. This module is designed for beginners who can already run a JavaScript file and now want their code to stop breaking for reasons they can't explain, and for career switchers who need to read error output the way a working developer does. No prior debugging experience is required, and everything runs in the free browser DevTools and a free editor. Along the way you'll see why JavaScript converts types behind your back, what == does that === does not, and which modern code-style rules prevent whole categories of variable bugs before they happen. You'll finish with a debugging checklist and a set of annotated error examples you can reuse whenever a script fails, in this course or in your own projects.
What's included
4 videos1 reading1 assignment
4 videos•Total 12 minutes
- Why Most Beginner Bugs Are Really Variable Bugs•3 minutes
- How JavaScript Behaves and the Code Style Rules Pros Follow•3 minutes
- Declaring Values with let and const and Picking a Data Type•3 minutes
- Reading a Stack Trace and Fixing Bugs with Breakpoints•3 minutes
1 reading•Total 10 minutes
- The Core Data Types and the Coercion Traps•10 minutes
1 assignment•Total 20 minutes
- Variables, Types, and Error Messages Check•20 minutes
Wondering how to make JavaScript decide something instead of just running top to bottom? This module answers exactly that question. By the end of this module you will write a script that branches on conditions and repeats over a set of data. You'll build conditions with if, else if, else, and switch, write for, while, and do...while loops, use the ternary operator for short decisions, and control iteration precisely with break and continue. This module is designed for beginners who can declare variables and now need real logic, and for anyone automating a repetitive task who wants the script to handle every case rather than one. No prior programming background is required, and every example runs in the browser console or in Node.js on any operating system. Along the way you'll learn which values JavaScript treats as truthy and falsy, why == and === behave differently inside a condition, and how to avoid the infinite loop that catches almost every beginner once. You'll finish with a working contact list script — add, search, and delete entries — plus a starter file you can extend into a larger tool, ready to reuse as the data layer of your first real application.
What's included
4 videos1 reading1 ungraded lab
4 videos•Total 13 minutes
- Why Every App Is Just Decisions and Repetition•3 minutes
- Branching Code with if, else if, else, and switch•4 minutes
- Repeating Work with for, while, and do...while•3 minutes
- Exiting and Skipping Iterations with break and continue•3 minutes
1 reading•Total 10 minutes
- Choosing Between if, switch, for, and while•10 minutes
1 ungraded lab•Total 40 minutes
- Add, Search, and Delete Contacts•40 minutes
Wondering how to store a list of users, products, or tasks in JavaScript and then filter it? This module answers exactly that question. By the end of this module you will transform a realistic dataset using array methods and object operations. You'll create and index arrays, add and remove items with push, pop, and splice, reshape data with map, filter, and reduce, loop with for...of and for...in, and add, update, and delete properties on objects. This module is designed for beginners who can already write loops and conditions and now need somewhere to put their data, and for analysts or marketers who want to process records in JavaScript instead of by hand. No prior experience with data structures is required, and all code runs in the browser console or in Node.js. Along the way you'll learn when an array is the right shape for your data and when an object is, why sorting and searching behave the way they do, and how to chain array methods without creating unreadable code. You'll finish with a live password strength checker built from your own array logic — length, uppercase, numbers, and special characters — plus a reusable data-handling snippet set, ready to drop into any future project.
What's included
4 videos1 reading1 assignment
4 videos•Total 13 minutes
- Arrays vs Objects: Choosing the Right Structure•3 minutes
- Creating and Indexing Arrays with push, map, and filter•3 minutes
- Looping Through Arrays and Objects with for...of and for...in•2 minutes
- Adding, Removing, Sorting, and Searching Items in a Dataset•5 minutes
1 reading•Total 10 minutes
- Array Method Reference: push, map, filter, reduce•10 minutes
1 assignment•Total 20 minutes
- Arrays, Objects, and Iteration Check•20 minutes
Wondering how to stop copying the same five lines of JavaScript into every file? This module answers exactly that question. By the end of this module you will refactor duplicated code into parameterised, reusable functions. You'll declare functions and call them, pass arguments and set default values, return results instead of printing them, write function expressions, and convert them into concise ES6 arrow functions. This module is designed for beginners who can already write loops and work with arrays, and for professionals automating tasks who want a small personal library of helpers rather than one long script. No prior experience with functional programming is required, and every example runs in the browser console or in Node.js. Along the way you'll learn what scope means in practice, why a function declaration is available before it appears in the file while a function expression is not, what return actually gives back to the caller, and when an arrow function is the better choice. You'll finish with a set of working utility functions — formatDate, calculateTip, and validateEmail — plus a refactored version of an earlier script, ready to reuse as the helpers file in every project you build next.
What's included
4 videos1 reading1 ungraded lab
4 videos•Total 10 minutes
- Why Copy-Pasted Code Breaks and Functions Don't•3 minutes
- Declaring a Function, Calling It, and Understanding Hoisting•2 minutes
- Passing Arguments, Setting Defaults, and Returning Results•2 minutes
- Writing Function Expressions and ES6 Arrow Functions•3 minutes
1 reading•Total 10 minutes
- Declaration vs Expression vs Arrow: When to Use Each•10 minutes
1 ungraded lab•Total 30 minutes
- Create a Bill-Splitting Calculator with Default Values•30 minutes
Wondering how to make a button on a web page actually do something when a visitor clicks it? This module answers exactly that question. By the end of this module you will change what a page shows in response to a user action. You'll read the DOM tree the browser builds from your HTML, select elements with querySelector, querySelectorAll, and getElementById, edit text, attributes, and classes from JavaScript, and attach behaviour with addEventListener for click and input events. This module is designed for beginners who can write functions and now want visible results in a browser, and for designers or marketers who need a page to react without waiting on a developer. No framework is required — no React, no jQuery — and the supplied HTML and CSS starter files mean no front-end experience is assumed. Along the way you'll learn why the DOM is a live tree rather than your source file, how an event travels through the page, and why attaching listeners in JavaScript is safer than writing onclick directly in HTML. You'll finish with an interactive page containing a working counter, a dark-mode toggle, and a like button, ready to publish as the first piece of your developer portfolio.
What's included
3 videos1 reading1 ungraded lab
3 videos•Total 9 minutes
- How the Browser Builds the DOM Tree from Your HTML•3 minutes
- Selecting Page Elements with querySelector and getElementById•3 minutes
- Responding to Clicks and Typing with addEventListener•3 minutes
1 reading•Total 10 minutes
- Changing Text, Classes, and Styles: Which One to Use•10 minutes
1 ungraded lab•Total 30 minutes
- Build a Live Profile Card Editor•30 minutes
Wondering how to make JavaScript wait for something slow without freezing the whole page? This module answers exactly that question. By the end of this module you will write a script that handles a delayed result without blocking execution. You'll schedule code with setTimeout and setInterval and clear them cleanly, create and chain promises with .then() and .catch(), and rewrite the same logic with async and await so it reads top to bottom. This module is designed for beginners who can write functions and manipulate the DOM and now need to work with data that arrives later, and for anyone preparing to call an API or a database from JavaScript. No prior experience with asynchronous programming is required, and every example runs in the browser console or in Node.js. Along the way you'll learn what the event loop does with your code, why a promise result cannot be read on the next line, how errors behave differently inside asynchronous functions, and when a plain callback still makes sense. You'll finish with a working asynchronous tool — a countdown plus a delayed data fetch handled with async/await — and an error-handling pattern you can reuse for every API call you write from here on.
What's included
4 videos1 reading1 assignment
4 videos•Total 13 minutes
- The Event Loop in Plain English•2 minutes
- Delaying and Repeating Code with setTimeout and setInterval•4 minutes
- Creating and Chaining Promises with .then() and .catch()•4 minutes
- Rewriting Promise Chains with async and await•3 minutes
1 reading•Total 10 minutes
- Callbacks, Promises, and async/await Side by Side•10 minutes
1 assignment•Total 20 minutes
- Timers, Promises, and async/await Check•20 minutes
Wondering how to combine everything you know into one JavaScript project you can show an employer? This module answers exactly that question. By the end of this module you will build and ship a complete to-do list application in plain JavaScript. You'll structure the app's data as an array of objects, render it into the DOM, wire up add, edit, delete, and mark-as-done with event listeners, and organise the code into named functions instead of one long file. This module is designed for learners who have covered variables, loops, functions, the DOM, and asynchronous basics and now want a finished artefact, and for career switchers who need a portfolio piece before their first application. No framework and no build tools are required — the whole project runs from an HTML file in any browser. Along the way you'll see how the pieces fit together in a real app, what a reviewer looks for in naming and file structure, and which next step — modern ES6+, React, Vue, or Node.js with Express — makes sense once this project is done. You'll finish with a working to-do list app and a written README, ready to link from your CV, your GitHub profile, or your first developer job application.
What's included
3 videos1 reading1 ungraded lab
3 videos•Total 9 minutes
- Why a Finished Project Beats a Certificate•2 minutes
- Walkthrough: A To-Do App That Adds, Edits, and Deletes Tasks•4 minutes
- Choosing Your Next Step: ES6+, React, Vue, or Node.js•3 minutes
1 reading•Total 10 minutes
- JavaScript Theory Library: Your One-File Quick Reference•10 minutes
1 ungraded lab•Total 45 minutes
- Build a Timed Multiple-Choice Quiz Game•45 minutes
Instructor

Offered by
Why people choose Coursera for their career

Felipe M.

Jennifer J.

Larry W.

Chaitanya A.

Break down barriers to learning with big savings


Start with easy savings for hard-working teams

Frequently asked questions
To access course materials, assignments, and earn a Certificate, you'll need to purchase the Certificate experience when you enroll in a course. Eligible learners may also have the option to start with a Free Trial. Some courses may also offer a Full Course, No Certificate option. This lets you access course materials, submit required assessments, and receive a final grade, but you won't be able to earn or purchase a Certificate.
When you purchase a Certificate you get access to all course materials, including graded assignments. Upon completing the course, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.
More questions
Financial aid available,
