How much of JavaScript do you really think you know? You probably know how to write functions, understand simple algorithms, and can even write a class. But do you know what a typed array is?
You don't need to know all of these concepts right now, but you will eventually need them later in your career. Thatโs why I recommend bookmarking this list, because chances are, youโll encounter one of these topics, and then youโre gonna want a tutorial to fully understand it.
Itโs important to note that this list was inspired from the following repository:
leonardomso
/
33-js-concepts
๐ 33 JavaScript concepts every developer should know.
Introduction
This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a requirement, but a guide for future studies. It is based on an article written by Stephen Curtis and you can read it here.
๐ Considered by GitHub as one of the top open source projects of 2018!
Community
Feel free to submit a PR by adding a link to your own recaps or reviews. If you want to translate the repo into your native language, please feel free to do so.
All the translations for this repo will be listed below:
- ุงูููุนูุฑูุจููููุฉูโ (Arabic) โ Amr Elsekilly
- ะัะปะณะฐััะบะธ (Bulgarian) - thewebmasterp
- ๆฑ่ฏญ (Chinese) โ Re Tian
- Portuguรชs do Brasil (Brazilian Portuguese) โ Tiago Boeing
- ํ๊ตญ์ด (Korean) โ Suin Lee
- Espaรฑol (Spanish) โ Adonis Mendoza
- Tรผrkรงe (Turkish) โ ฤฐlker Demir
- ััััะบะธะน ัะทัะบ (Russian) โโฆ
Please give the author and contributors of the 33 JS Concepts repository some love for gathering this amazing list of resources! โค๏ธ
So without further ado, letโs begin!
Table of Contents
- Call Stack
- Primitive Types
- Value Types and Reference Types
- Implicit, Explicit, Nominal, Structuring and Duck Typing
- == vs === vs typeof
- Function Scope, Block Scope and Lexical Scope
- Expression vs Statement
- IIFE, Modules and Namespaces
- Message Queue and Event Loop
- setTimeout, setInterval and requestAnimationFrame
- JavaScript Engines
- Bitwise Operators, Type Arrays and Array Buffers
- DOM and Layout Trees
- Factories and Classes
- this, call, apply and bind
- new, Constructor, instanceof and Instances
- Prototype Inheritance and Prototype Chain
- Object.create and Object.assign
- map, reduce, filter
- Pure Functions, Side Effects, State Mutation and Event Propagation
- Closures
- High Order Functions
- Recursion
- Collections and Generators
- Promises
- async/await
- Data Structures
- Expensive Operation and Big O Notation
- Algorithms
- Inheritance, Polymorphism and Code Reuse
- Design Patterns
- Partial Applications, Currying, Compose and Pipe
- Clean Code
1. Call Stack
A call stack is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions โ what function is currently being run and what functions are called from within that function, etc.
โSource
Tutorials
- ๐ Understanding Javascript Call Stack, Event Loops โ Gaurav Pandvia
- ๐ Understanding the JavaScript Call Stack โ Charles Freeborn
- ๐ Javascript: What Is The Execution Context? What Is The Call Stack? โ Valentino Gagliardi
2. Primitive Types
All types except objects define immutable values (that is, values which can't be changed). For example (and unlike in C), Strings are immutable. We refer to values of these types as "primitive values".
โSource
Tutorials
- ๐ How numbers are encoded in JavaScript โ Dr. Axel Rauschmayer
- ๐ What You Need to Know About JavaScript Number Type โ Max Wizard K
- ๐ What Every JavaScript Developer Should Know About Floating Point Numbers โ Chewxy
3. Value Types and Reference Types
Variables that are assigned a non-primitive value are given a reference to that value. That reference points to the objectโs location in memory. The variables donโt actually contain the value.
โSource
Tutorials
- ๐ Explaining Value vs. Reference in Javascript โ Arnav Aggarwal
- ๐ Primitive Types & Reference Types in JavaScript โ Bran van der Meer
- ๐ Value Types, Reference Types and Scope in JavaScript โ Ben Aston
4. Implicit, Explicit, Nominal, Structuring and Duck Typing
Type coercion means that when the operands of an operator are different types, one of them will be converted to an "equivalent" value of the other operand's type.
โSource
Tutorials
- ๐ What you need to know about Javascript's Implicit Coercion โ Promise Tochi
- ๐ JavaScript Type Coercion Explained โ Alexey Samoshkin
- ๐ Javascript Coercion Explained โ Ben Garrison
5. == vs === vs typeof
JavaScript has two visually similar, yet very different, ways to test equality. You can test equality with == or ===.
โSource
Tutorials
- ๐ JavaScript Double Equals vs. Triple Equals โ Brandon Morelli
- ๐ Should I use === or == equality comparison operator in JavaScript? โ Panu Pitkamaki
- ๐ == vs === JavaScript: Double Equals and Coercion โ AJ Meyghani
6. Function Scope, Block Scope and Lexical Scope
It is important to make this distinction because expressions can act like statements, which is why we also have Expression statements. Though, on other the hand, statements cannot act like expressions.
โSource
Tutorials
- ๐ JavaScript FunctionsโUnderstanding The Basics โ Brandon Morelli
- ๐ The battle between Function Scope and Block Scope โ Marius Herring
- ๐ Emulating Block Scope in JavaScript โ Josh Clanton
7. Expression vs Statement
It is important to make this distinction because expressions can act like statements, which is why we also have Expression statements. Though, on other the hand, statements cannot act like expressions.
โSource
Tutorials
- ๐ All you need to know about Javascript's Expressions, Statements and Expression Statements โ Promise Tochi
- ๐ Function Expressions vs Function Declarations โ Paul Wilkins
- ๐ JavaScript Function โ Declaration vs Expression โ Ravi Roshan
8. IIFE, Modules and Namespaces
One of the often used coding patterns with functions has got a fancy name for itself: Immediately-invoked Function Expression. Or more dearly known as IIFE and pronounced as โiffy.โ
โSource
Tutorials
- ๐ Mastering Immediately-Invoked Function Expressions โ Chandra Gundamaraju
- ๐ Do ES6 Modules make the case of IIFEs obsolete?
- ๐ A 10 minute primer to JavaScript modules, module formats, module loaders and module bundlers โ Jurgen Van de Moere
9. Message Queue and Event Loop
โHow is JavaScript asynchronous and single-threaded ?โ The short answer is that JavaScript language is single-threaded and the asynchronous behaviour is not part of the JavaScript language itself, rather they are built on top of the core JavaScript language in the browser (or the programming environment) and accessed through the browser APIs.
โSource
Tutorials
- ๐ JavaScript Event Loop Explained โ Anoop Raveendran
- ๐ The JavaScript Event Loop: Explained โ Erin Sweson-Healey
- ๐ Understanding JS: The Event Loop โ Alexander Kondov
10. setTimeout, setInterval and requestAnimationFrame
We may decide to execute a function not right now, but at a certain time later. Thatโs called โscheduling a callโ.
โSource
Tutorials
- ๐ setTimeout and setInterval โ JavaScript.Info
- ๐ Why not to use setInterval โ Akanksha Sharma
- ๐ setTimeout VS setInterval โ Develoger
11. JavaScript Engines
Writing code for the Web sometimes feels a little magical in that developers write a sequence of characters and like magic, those characters turn into concrete images, words, and actions within a browser. Understanding the technology can help developers better tune their craft as programmers.
โSource
Tutorials
- ๐ JavaScript Engines โ Jen Looper
- ๐ Understanding How the Chrome V8 Engine Translates JavaScript into Machine Code โ DroidHead
- ๐ Understanding V8โs Bytecode โ Franziska Hinkelmann
12. Bitwise Operators, Type Arrays and Array Buffers
Okay, so technically for the computer everything goes down to 1s and 0s. It does not operate with digits or characters or strings, it uses only binary digits (bits). The short version of this explanation is that everything is stored in binary form. Then the computer uses encodings such as UTF-8 to map the saved bit combinations to characters, digits or different symbols (the ELI5 version).
โSource
Tutorials
- ๐ Programming with JS: Bitwise Operations โ Alexander Kondov
- ๐ Using JavaScriptโs Bitwise Operators in Real Life โ ian m
- ๐ JavaScript Bitwise Operators โ w3resource
13. DOM and Layout Trees
The Document Object Model, usually referred to as the DOM, is an essential part of making websites interactive. It is an interface that allows a programming language to manipulate the content, structure, and style of a website. JavaScript is the client-side scripting language that connects to the DOM in an internet browser.
โSource
Tutorials
- ๐ How To Understand and Modify the DOM in JavaScript โ Tania Rascia
- ๐ Whatโs the Document Object Model, and why you should know how to use it โ Leonardo Maldonado
- ๐ JavaScript DOM Tutorial with Example โ Guru99
14. Factories and Classes
JavaScript is a prototype-based language, meaning object properties and methods can be shared through generalized objects that have the ability to be cloned and extended. This is known as prototypical inheritance and differs from class inheritance.
โSource
Tutorials
- ๐ How To Use Classes in JavaScript โ Tania Rascia
- ๐ Javascript Classes โ Under The Hood โ Majid
- ๐ ES6 Classes โ Nathaniel Foster
15. this, call, apply and bind
These functions are very important for every JavaScript Developer and are used in almost every JavaScript Library or Framework.
โSource
Tutorials
- ๐ Grokking call(), apply() and bind() methods in JavaScript โ Aniket Kudale
- ๐ How-to: call() , apply() and bind() in JavaScript โ Niladri Sekhar Dutta
- ๐ JavaScriptโs Apply, Call, and Bind Methods are Essential for JavaScript Professionals โ Richard Bovell
16. new, Constructor, instanceof and Instances
Every JavaScript object has a prototype. All objects in JavaScript inherit their methods and properties from their prototypes.
โSource
Tutorials
- ๐ JavaScript For Beginners: the โnewโ operator โ Brandon Morelli
- ๐ Letโs demystify JavaScriptโs โnewโ keyword โ Cynthia Lee
- ๐ Constructor, operator "new" โ JavaScript.Info
17. Prototype Inheritance and Prototype Chain
JavaScript is a bit confusing for developers experienced in class-based languages (like Java or C++), as it is dynamic and does not provide a class implementation per se (the class keyword is introduced in ES2015, but is syntactical sugar, JavaScript remains prototype-based).
โSource
Tutorials
- ๐ Javascript : Prototype vs Class โ Valentin PARSY
- ๐ JavaScript engine fundamentals: optimizing prototypes โ Mathias Bynens
- ๐ JavaScript Prototype โ NC Patro
18. Object.create and Object.assign
The Object.create method is one of the methods to create a new object in JavaScript.
โSource
Tutorials
- ๐ Object.create in JavaScript โ Rupesh Mishra
- ๐ Object.create(): the New Way to Create Objects in JavaScript โ Rob Gravelle
- ๐ Basic Inheritance with Object.create โ Joshua Clanton
19. map, reduce, filter
Even if you donโt know what functional programming is youโve probably been using map, filter and reduce just because theyโre so incredibly useful and make your code stink less by allowing you to write cleaner logic.
โSource
Tutorials
- ๐ JavaScript Functional Programming โ map, filter and reduce โ Bojan Gvozderac
- ๐ Learn map, filter and reduce in Javascript โ Joรฃo Miguel Cunha
- ๐ JavaScriptโs Map, Reduce, and Filter โ Dan Martensen
20. Pure Functions, Side Effects, State Mutation and Event Propagation
So many of our bugs are rooted in IO related, data mutation, side effect bearing code. These creep up all over our code baseโfrom things like accepting user inputs, receiving an unexpected response via an http call, or writing to the file system. Unfortunately, this is a harsh reality that we should grow accustomed to dealing with. Or is it?
โSource
Tutorials
- ๐ Javascript and Functional Programming โ Pure Functions โ Omer Goldberg
- ๐ Master the JavaScript Interview: What is a Pure Function? โ Eric Elliott
- ๐ JavaScript: What Are Pure Functions And Why Use Them? โ James Jeffery
21. Closures
A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.
โSource
Tutorials
- ๐ I never understood JavaScript closures โ Olivier De Meulder
- ๐ Understand JavaScript Closures With Ease โ Richard Bovell
- ๐ Understanding JavaScript Closures โ Codesmith
22. High Order Functions
JavaScript can accept higher-order functions. This ability to handle higher-order functions, among other characteristics, makes JavaScript one of the programming languages well-suited for functional programming.
โSource
Tutorials
- ๐ Higher-Order Functions in JavaScript โ M. David Green
- ๐ Higher Order Functions: Using Filter, Map and Reduce for More Maintainable Code โ Guido Schmitz
- ๐ First-class and Higher Order Functions: Effective Functional JavaScript โ Hugo Di Francesco
23. Recursion
Consider this post as a series of learning exercises. These examples are designed to make you think โ and, if Iโm doing it right, maybe expand your understanding of functional programming a little bit.
โSource
Tutorials
- ๐ Recursion in JavaScript โ Kevin Ennis
- ๐ Understanding Recursion in JavaScript โ Zak Frisch
- ๐ Learn and Understand Recursion in JavaScript โ Brandon Morelli
24. Collections and Generators
The Generator object is returned by a generator function and it conforms to both the iterable protocol and the iterator protocol.
โSource
Tutorials
- ๐ ES6 In Depth: Collections โ Jason Orendorff
- ๐ ES6 Collections: Using Map, Set, WeakMap, WeakSet โ Kyle Pennell
- ๐ ES6 WeakMaps, Sets, and WeakSets in Depth โ Nicolรกs Bevacqua
25. Promises
The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.
โSource
Tutorials
- ๐ JavaScript Promises for Dummies โ Jecelyn Yeen
- ๐ Understanding promises in JavaScript โ Gokul N K
- ๐ Master the JavaScript Interview: What is a Promise? โ Eric Elliott
26. async/await
Thereโs a special syntax to work with promises in a more comfortable fashion, called โasync/awaitโ. Itโs surprisingly easy to understand and use.
โSource
Tutorials
- ๐ Understanding async/await in Javascript โ Gokul N K
- ๐ Exploring Async/Await Functions in JavaScript โ Alligator.io
- ๐ Asynchronous Javascript using async/await โ Joy Warugu
27. Data Structures
Javascript is evolving each day. With the rapid growth of frameworks and platforms like React, Angular, Vue, NodeJS, Electron, React Native, it has become quite common to use javascript for large-scale applications.
โSource
Tutorials
- ๐ Data Structures in JavaScript โ Thon Ly
- ๐ Algorithms and Data Structures in JavaScript โ Oleksii Trekhleb
- ๐ Data Structures: Objects and Arrays โ Chris Nwamba
28. Expensive Operation and Big O Notation
โWhat is Big O Notation?โ that is a very common job interview question for developers. In short, it is the mathematical expression of how long an algorithm takes to run depending on how long is the input, usually talking about the worst case scenario.
โSource
Tutorials
- ๐ Big O Notation in Javascript โ Cรฉsar Antรณn Dorantes
- ๐ Time Complexity/Big O Notation โ Tim Roberts
- ๐ Big O in JavaScript โ Gabriela Medina
29. Algorithms
In mathematics and computer science, an algorithm is a finite sequence of well-defined instructions, typically used to solve a class of specific problems or to perform a computation.
Tutorials
- ๐ Data Structures and Algorithms using ES6
- ๐ Algorithms and data structures implemented in JavaScript with explanations and links to further readings
- ๐ JS: Interview Algorithm
30. Inheritance, Polymorphism and Code Reuse
Class inheritance is a way for one class to extend another class, so we can create new functionality on top of the existing.
โSource
Tutorials
- ๐ Inheritance in JavaScript โ Rupesh Mishra
- ๐ Simple Inheritance with JavaScript โ David Catuhe
- ๐ JavaScript โ Inheritance, delegation patterns and Object linking โ NC Patro
31. Design Patterns
Every developer strives to write maintainable, readable, and reusable code. Code structuring becomes more important as applications become larger. Design patterns prove crucial to solving this challenge - providing an organization structure for common issues in a particular circumstance.
โSource
Tutorials
- ๐ 4 JavaScript Design Patterns You Should Know โ Devan Patel
- ๐ JavaScript Design Patterns โ Beginner's Guide to Mobile Web Development โ Soumyajit Pathak
- ๐ JavaScript Design Patterns โ Akash Pal
32. Partial Applications, Currying, Compose and Pipe
Function composition is a mechanism of combining multiple simple functions to build a more complicated one.
โSource
Tutorials
- ๐ Use function composition in JavaScript โ Rรฉmi
- ๐ Currying in JavaScript ES6 โ Adam Bene
- ๐ Composition and Currying Elegance in JavaScript โ Pragyan Das
33. Clean Code
Writing clean, understandable, and maintainable code is a skill that is crucial for every developer to master.
โSource
Tutorials
- ๐ Clean Code Explained โ A Practical Introduction to Clean Coding for Beginners โ freeCodeCamp
- ๐ Clean Code concepts adapted for JavaScript โ Ryan McDermott
- ๐ Clean Code Practice: How to write clean code โ Tirth Bodawala
If you found this list useful, donโt forget to bookmark it and to follow me for more content like this.
![[deleted user] image](https://res.cloudinary.com/practicaldev/image/fetch/s--xtH13c6f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://res.cloudinary.com/practicaldev/image/fetch/s--diPD5F8K--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://thepracticaldev.s3.amazonaws.com/i/99mvlsfu5tfj9m7ku25d.png)
[Deleted User]
Top comments (16)
Nice!
โค๏ธ
Can I translate it into Chinese? I will indicate the original link.
yep!
Very nice selection!
Thanks! ๐ค
A nice collection BUT.
Please carefully check your links and resources. I will dismiss any applicant that uses var or iffies without a very good reason. Articles that aim to extend knowledge should not use outdated syntax and especially not promote obsolete/legacy practices. The links regarding Design patterns are so outdated you could run them in IE6.
PLEASE don't promote legacy practices. Junior developers come here to seek best practices. These links teach ancient history.
Hi, Good point! They probably reused an old post...
Nice Selection!
Cool!
Very nicely explained!
Oh wow. This is pretty impressive, thanks for your hard work!
Cool! :)
Thank you for your post!
OMG! This is what I was looking for! Thank you for gathering this together!
Thanks ๐
Some comments may only be visible to logged-in visitors. Sign in to view all comments.