JavaScript Crash Course

Learn JavaScript from your first line of code to interactive web pages: variables, decisions, loops, functions, arrays, objects, the DOM, events, forms, async and a final to-do app.

  • 0 students
  • 232 lessons
  • 13 h 34 min

Created by Ayim Nelson

What you will learn

  • Write and run JavaScript programs and read error messages
  • Use variables, data types, operators and strings
  • Control programs with if/else, switch, logical operators and loops
  • Write functions with parameters, return values and callbacks
  • Work with arrays, array methods, objects and JSON
  • Find and fix bugs and handle errors with try/catch
  • Select, change, create and remove page elements with the DOM
  • Respond to clicks, typing and form submits with events
  • Use timers, promises, async/await and fetch
  • Save data in the browser with localStorage and build a complete to-do app

About this course

JavaScript is the programming language of the web. You start by writing small programs in the console, then use the same skills to make web pages change, respond to clicks and remember data.

Every lesson is short and ends with a quick quiz, every section ends with a review quiz, and you finish by building a to-do list app.

For: complete beginners on a phone or laptop. Knowing a little HTML helps from section 10.

By the end: you can write your own JavaScript programs and build small interactive pages that save data.

Course content

14 sections · 232 lessons

Getting started14 lessons
Values, variables and types18 lessons
  • Variables: labelled boxesReading · 2 min
  • Changing what is in the boxReading · 2 min
  • Boxes that never change: constReading · 2 min
  • Using boxes togetherReading · 2 min
  • Naming rulesReading · 2 min
  • A short word on varReading · 2 min
  • Numbers and operatorsReading · 2 min
  • The remainder operator %Reading · 2 min
  • Order of operationsReading · 2 min
  • Updating a value: += and ++Reading · 2 min
  • Math helpersReading · 3 min
  • Data typesReading · 4 min
  • undefined and nullReading · 2 min
  • Asking the type with typeofReading · 2 min
  • The '5' + 2 surpriseReading · 2 min
  • Turning text into a number with Number()Reading · 2 min
  • Jollof party budgetExercise · 12 min
  • Section 2 reviewQuiz · 8 min
Working with text15 lessons
  • Strings and template literalsReading · 2 min
  • Joining strings with +Reading · 2 min
  • Template literals: the easy wayReading · 2 min
  • Text on more than one lineReading · 2 min
  • String methodsReading · 2 min
  • Indexing: one character at a timeReading · 2 min
  • toUpperCase and toLowerCaseReading · 2 min
  • trim: remove extra spacesReading · 2 min
  • includes: is this text inside?Reading · 2 min
  • slice: cut out a pieceReading · 2 min
  • replace: swap textReading · 2 min
  • split: break a string into piecesReading · 2 min
  • Chaining methodsReading · 2 min
  • Name tag formatterExercise · 12 min
  • Section 3 reviewQuiz · 8 min
Making decisions21 lessons
  • Comparisons and booleansReading · 2 min
  • Comparison operatorsReading · 4 min
  • Storing a comparisonReading · 2 min
  • One = is not a comparisonReading · 2 min
  • Why we use === and not ==Reading · 2 min
  • Comparing stringsReading · 2 min
  • if, else if and elseReading · 2 min
  • elseReading · 2 min
  • else if: more than two choicesReading · 2 min
  • Order mattersReading · 2 min
  • Setting a variable in each branchReading · 2 min
  • Logical operatorsReading · 2 min
  • && (and)Reading · 2 min
  • || (or)Reading · 2 min
  • Truthy and falsyReading · 4 min
  • switch: many fixed choicesReading · 3 min
  • Forgetting breakReading · 2 min
  • Sharing one answerReading · 2 min
  • The ternary operator: a short if/elseReading · 3 min
  • WASSCE grade checkerExercise · 12 min
  • Section 4 reviewQuiz · 8 min
Repeating with loops10 lessons
  • while loopsReading · 3 min
  • CountersReading · 3 min
  • Avoid infinite loopsReading · 2 min
  • A loop that may not run at allReading · 2 min
  • for loops, break and continueReading · 5 min
  • Looping over a stringReading · 2 min
  • break: stop the loop earlyReading · 2 min
  • continue: skip to the next roundReading · 2 min
  • Times table and countdownExercise · 12 min
  • Section 5 reviewQuiz · 8 min
Functions19 lessons
  • What a function isReading · 2 min
  • Declaring a functionReading · 2 min
  • Calling a functionReading · 2 min
  • Why functions helpReading · 2 min
  • Parameters and argumentsReading · 3 min
  • Returning a valueReading · 3 min
  • Default parametersReading · 2 min
  • Printing is not returningReading · 2 min
  • Scope: where variables liveReading · 2 min
  • Function scopeReading · 2 min
  • Block scopeReading · 3 min
  • Inside can see out, outside cannot see inReading · 2 min
  • Good habitsReading · 2 min
  • Arrow functionsReading · 4 min
  • Functions are valuesReading · 2 min
  • Callbacks: passing a function to a functionReading · 3 min
  • The handler vs handler() mistakeReading · 2 min
  • Rock, paper, scissors: playRoundExercise · 12 min
  • Section 6 reviewQuiz · 9 min
Arrays22 lessons
  • Array basicsReading · 2 min
  • Indexes start at 0Reading · 2 min
  • lengthReading · 2 min
  • Adding and removing itemsReading · 2 min
  • Is it on the list?Reading · 2 min
  • Turning a list into text: joinReading · 2 min
  • Looping through arraysReading · 2 min
  • for...of: just the itemsReading · 2 min
  • forEach: a function for each itemReading · 2 min
  • Adding up a totalReading · 2 min
  • Counting items that matchReading · 2 min
  • Which loop should I use?Reading · 2 min
  • map: change every itemReading · 4 min
  • filter: keep only some itemsReading · 2 min
  • Do not forget to returnReading · 2 min
  • Using them togetherReading · 2 min
  • find: the first matchReading · 2 min
  • reduce: add everything upReading · 3 min
  • sort: putting things in orderReading · 3 min
  • sort changes the originalReading · 2 min
  • Class results reportExercise · 12 min
  • Section 7 reviewQuiz · 9 min
Objects18 lessons
  • Object basicsReading · 3 min
  • Reading a property: bracket accessReading · 2 min
  • Changing and adding propertiesReading · 2 min
  • A method: a function inside an objectReading · 2 min
  • Arrays of objectsReading · 3 min
  • filter: keep some objectsReading · 2 min
  • map: turn each object into something elseReading · 2 min
  • Putting them togetherReading · 3 min
  • Destructuring and spreadReading · 2 min
  • Destructuring an arrayReading · 2 min
  • Spread: copying an arrayReading · 2 min
  • Spread: copying and merging objectsReading · 2 min
  • JSONReading · 2 min
  • Object to text: JSON.stringifyReading · 2 min
  • Text to object: JSON.parseReading · 2 min
  • Why this matters laterReading · 2 min
  • Chop bar menuExercise · 15 min
  • Section 8 reviewQuiz · 10 min
Debugging and errors11 lessons
  • Errors you will meetReading · 4 min
  • Logic bugs: no error, wrong answerReading · 3 min
  • Hunting a logic bugReading · 3 min
  • Tips for good bug huntingReading · 2 min
  • try and catchReading · 3 min
  • The error objectReading · 2 min
  • throw: make your own errorReading · 3 min
  • finally: always runsReading · 2 min
  • When to use try/catchReading · 2 min
  • Fix the fare calculatorExercise · 15 min
  • Section 9 reviewQuiz · 10 min
The DOM: changing the page18 lessons
  • The DOM and selecting elementsReading · 2 min
  • Where to put your scriptReading · 2 min
  • Selecting one element: querySelectorReading · 2 min
  • Selecting many elements: querySelectorAllReading · 2 min
  • You will also see getElementByIdReading · 2 min
  • Changing text and attributesReading · 2 min
  • innerHTML: text with tagsReading · 2 min
  • AttributesReading · 2 min
  • Shortcut properties: src, href and disabledReading · 3 min
  • Changing styles and classesReading · 3 min
  • classList: the preferred wayReading · 3 min
  • Which one should I use?Reading · 2 min
  • Creating and removing elementsReading · 4 min
  • Removing an elementReading · 2 min
  • Building a list from an arrayReading · 3 min
  • Clearing a listReading · 2 min
  • Market price boardExercise · 15 min
  • Section 10 reviewQuiz · 9 min
Events18 lessons
  • Events and addEventListenerReading · 2 min
  • addEventListenerReading · 2 min
  • Pass the handler, do not call itReading · 2 min
  • Arrow functions as handlersReading · 2 min
  • Why not onclick in the HTML?Reading · 2 min
  • A click counterReading · 2 min
  • The event object, input and keyboard eventsReading · 2 min
  • The input event: live typingReading · 3 min
  • keydown and event.keyReading · 3 min
  • Listening for keys on the whole pageReading · 2 min
  • Which event should I use?Reading · 2 min
  • Event bubbling and delegationReading · 2 min
  • Event delegationReading · 2 min
  • Check what was clickedReading · 2 min
  • Telling buttons apart with an idReading · 2 min
  • Why delegation is usefulReading · 2 min
  • Rock, paper, scissors with buttonsExercise · 15 min
  • Section 11 reviewQuiz · 9 min
Forms and validation13 lessons
  • Form submit and reading valuesReading · 2 min
  • The submit eventReading · 2 min
  • preventDefault: stop the reloadReading · 2 min
  • Reading values with .valueReading · 2 min
  • Number boxes still give you textReading · 2 min
  • Select boxes and checkboxesReading · 2 min
  • Clearing and focusing inputsReading · 2 min
  • Validating inputReading · 2 min
  • Checking numbersReading · 2 min
  • Friendly error messages on the pageReading · 2 min
  • Built-in checks: required and minReading · 3 min
  • Trotro fare splitterExercise · 15 min
  • Section 12 reviewQuiz · 8 min
Timers and async JavaScript24 lessons
  • setTimeout: run once, laterReading · 2 min
  • Now first, later secondReading · 2 min
  • setInterval: run again and againReading · 2 min
  • Stopping a timer: clearIntervalReading · 2 min
  • Timers on a web pageReading · 2 min
  • A note about the console tasksReading · 2 min
  • What a promise isReading · 2 min
  • Making a promiseReading · 2 min
  • then: when it worksReading · 2 min
  • catch: when it failsReading · 2 min
  • Chaining: one step after anotherReading · 3 min
  • async and awaitReading · 2 min
  • Before and afterReading · 2 min
  • Several steps, top to bottomReading · 2 min
  • Errors: try and catchReading · 2 min
  • Two common mistakesReading · 2 min
  • Arrow functions can be async tooReading · 2 min
  • Getting data with fetchReading · 2 min
  • Checking response.okReading · 2 min
  • A fake fetch for practiceReading · 3 min
  • Using the fake fetchReading · 3 min
  • Show a loading messageReading · 3 min
  • Load the menuExercise · 15 min
  • Section 13 reviewQuiz · 10 min
Final project: to-do list11 lessons
  • Saving data with localStorageReading · 2 min
  • Saving, reading and removingReading · 2 min
  • localStorage only keeps textReading · 2 min
  • JSON to the rescueReading · 2 min
  • The first time the page opensReading · 2 min
  • Planning the to-do appReading · 2 min
  • To-do step 1: add and show tasksExercise · 15 min
  • To-do step 2: done and deleteExercise · 15 min
  • To-do step 3: remember tasksExercise · 15 min
  • Section 14 reviewQuiz · 10 min
  • Final examQuiz · 25 min

Reviews

No reviews yet.

Comments

Log in to join the conversation.

Loading comments...