JavaScript — 160 free lessons

the language that runs the page · syntax · dom · async

Start lesson 1 →

JS Tutorial

1. Why JavaScript · The Language of the Web2. How to Add JavaScript · Inline · Internal · External3. Syntax · Statements · Expressions4. Comments · Single · Multi · Jsdoc5. Variables · Var · Let · Const6. Hoisting · What Runs Before what7. Data Types · Primitives vs Objects

JS Numbers & Strings

8. Numbers · Int · Float · NaN · Infinity9. Number Methods · ToFixed · ParseInt · IsFinite10. Bigint · Arbitrary Precision11. Strings · Single · Double · Backtick12. Template Literals · Interpolation13. String Methods · Slice · Split · Replace14. Booleans · Truthy · Falsy

JS Operators

15. Operators · Arithmetic16. Operators · Assignment · += · -= · ??=17. Operators · Comparison · == vs ===18. Operators · Logical · && · || · !19. Operators · Nullish · ??20. Operators · Ternary · Short-Circuit21. Operators · Spread · REST22. Destructuring · Arrays · Objects

JS Control Flow

23. If · Else · Else If24. Switch · Case · Break · Default25. For Loops · Classic26. For...in · Iterating Keys27. For...of · Iterating Values28. While · Do-While29. Break · Continue · Labels

JS Functions

30. Functions · Declaration · Expression31. Arrow Functions · Shorthand32. Parameters · Default · REST33. Return Values · Explicit vs Implicit34. Scope · Global · Function · Block35. Closures · The Function Memory Trick36. Iife · Self-Invoking Patterns37. Recursion · Function Calls Itself38. This · What it Points to39. Call · Apply · Bind · Changing This40. Arguments · The Legacy Array-Like

JS Objects

41. Objects · Key · Value Pairs42. Object Methods · Keys · Values · Entries43. Object Methods · Assign · Freeze · Seal44. Spread on Objects · Merging45. Computed Property Names46. Getters · Setters · Accessors

JS Arrays

47. Arrays · Ordered Lists48. Array Methods · Push · Pop · Shift · Unshift49. Array Methods · Slice · Splice50. Array Methods · Map · Filter · Reduce51. Array Methods · Find · FindIndex · Some · Every52. Array Methods · Sort · Reverse53. Array Methods · Flat · FlatMap54. Array-Like vs Array55. Iterators · Symbol.iterator56. Generators · Function* · Yield

JS Dates & Math

57. Dates · The Date Object58. Date Methods · Format · Parse · Arithmetic59. Math · Floor · Ceil · Round · Random

JS Regex

60. Regex · Pattern Matching61. Regex · Flags · G · I · M · S · U · Y62. Regex · Groups · Capture · Backreference63. Regex · Lookahead · Lookbehind

JS JSON & Errors

64. JSON · Parse · Stringify · Replacer · Reviver65. Errors · Try · Catch · Finally66. Errors · Throwing · Custom Error Classes67. Errors · Stack Traces

JS Classes & OOP

68. Classes · The ES6 Syntax69. Classes · constructor · Methods · Getters70. Classes · Inheritance · Extends · Super71. Classes · Static · Private · #fields72. Prototypes · The Old Inheritance73. Symbols · Unique Keys

JS Collections

74. Map · Ordered Key-Value Store75. Set · Unique Values76. Weakmap · Weakset · Gc-Friendly

JS Gotchas

77. Typeof vs Instanceof78. Truthy / Falsy Gotchas79. NaN · Why IsNaN is Weird80. Strict Mode · "use Strict"

JS Modules

81. Modules · Import · Export82. Modules · Default vs Named83. Dynamic Import · Code Splitting84. Modules · Re-Exports · Barrel Files

JS DOM

85. The DOM · The Document Object Model86. Selecting · QuerySelector · GetElementById87. Selecting · QuerySelectorAll · Live vs Static88. Traversal · ParentNode · Children · Siblings89. Creating Elements · CreateElement · AppendChild90. Removing Elements · Remove · RemoveChild91. Attributes · GetAttribute · SetAttribute · Dataset92. Classes · ClassList · Add · Remove · Toggle93. Styles · Element.style · GetComputedStyle94. Forms · Accessing Values

JS Events

95. Events · AddEventListener · RemoveEventListener96. Event Object · Target · CurrentTarget97. Event Bubbling · Capturing · Delegation98. Event Types · Click · Input · Change · Submit99. Event Types · Keyboard · Keydown · Keyup100. Event Types · Mouse · Mousedown · Mouseup · Wheel101. Event Types · Pointer · Touch · Drag102. Event Types · Focus · Blur · Load · Resize103. Custom Events · New CustomEvent · DispatchEvent

JS Timing

104. Timing · SetTimeout · SetInterval · ClearTimeout105. RequestAnimationFrame · The Render Loop

JS Async

106. Callbacks · The Original Async107. Callback Hell · The Nested Problem108. Promises · Pending · Fulfilled · Rejected109. Promises · Then · Catch · Finally110. Promises · All · AllSettled · Race · Any111. Async / Await · Sugar for Promises112. Error Handling · Try / Catch Around Await

JS HTTP & Networking

113. Fetch · The Modern HTTP Client114. Fetch · Request · Response · Headers115. Fetch · POST · PUT · DELETE116. Fetch · Streaming · ReadableStream117. Abort Controller · Cancelable Requests118. Xhr · The Legacy XMLHttpRequest119. Websockets · Client API120. Server-Sent Events · EventSource121. Broadcast Channel · Cross-Tab Messaging122. Message Channel · Structured Cloning

JS Storage & Cookies

123. LocalStorage · Key-Value Persistence124. SessionStorage · Tab-Scoped125. IndexedDB · The Browser Database126. Cookies · Document.cookie

JS Window & History

127. History API · PushState · ReplaceState128. Location · Hash · Search · Hostname129. Navigator · Ua · Clipboard · Share130. Window · InnerWidth · ScrollY · Open131. Document · Title · CreateElement · Cookie

JS Browser APIs

132. Canvas API · 2D Drawing133. Webgl · The 3D Gpu Interface134. Web Audio API · Oscillators · Gain · Context135. Webrtc · Peer-To-Peer Media136. Media Devices · GetUserMedia137. Notifications · The Browser Notification API138. Geolocation · GetCurrentPosition · WatchPosition139. Clipboard API · ReadText · WriteText140. Drag and Drop API · Dragstart · Drop141. File API · File · Blob · FileReader142. Service Workers · Install · Activate · Fetch143. Cache API · Putting Responses in Cache144. Web Workers · PostMessage · Transferable145. Shared Workers · Cross-Tab Compute146. Worklets · Paint · Audio · Animation147. Crypto API · RandomUUID · Subtle.digest148. Webauthn · Passkeys · Biometrics

JS ES Versions

149. ES6 Recap · Let · Const · Arrow · Class150. ES2020 · Optional Chaining · Nullish Coalescing151. ES2021 · ReplaceAll · Numeric Separators152. ES2022 · Top-Level Await · #private Fields153. ES2023 · Array Find from Last · Symbol.dispose154. ES2024 · GroupBy · Promise.withResolvers

JS Tooling

155. TypeScript · Adding Types to JavaScript156. Linting · Eslint · Prettier157. Testing · Jest · Vitest · Playwright158. Performance · Profiling · Devtools159. Memory · The V8 Heap · Gc Cycles

JS References

160. References · Examples · Exercises · Certificate