Convert Figma logo to code with AI

getify logoYou-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.

178,865
33,440
178,865
125

Top Related Projects

Modern JavaScript Tutorial

144,559

JavaScript Style Guide

:bathtub: Clean Code concepts adapted for JavaScript

📜 33 JavaScript concepts every developer should know.

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

A long list of (advanced) JavaScript questions, and their explanations :sparkles:

Quick Overview

"You Don't Know JS" is a comprehensive book series on JavaScript, written by Kyle Simpson. It aims to provide an in-depth understanding of JavaScript's core mechanisms, diving deep into the language's intricacies and often-misunderstood concepts. The series is designed for both beginners and experienced developers looking to solidify their JavaScript knowledge.

Pros

  • Offers a deep, thorough exploration of JavaScript fundamentals
  • Free and open-source, making it accessible to all learners
  • Regularly updated to reflect the latest JavaScript features and best practices
  • Written in a clear, engaging style with practical examples

Cons

  • Can be overwhelming for absolute beginners due to its depth
  • Some concepts may require multiple readings to fully grasp
  • The series is quite lengthy, which might be time-consuming for busy developers
  • May contain some advanced topics that are not immediately applicable for all readers

Code Examples

This is not a code library, so code examples are not applicable.

Getting Started

As this is a book series and not a code library, there are no specific getting started instructions. However, readers can begin by visiting the GitHub repository at https://github.com/getify/You-Dont-Know-JS and accessing the books in the order they are presented:

  1. Get Started
  2. Scope & Closures
  3. Objects & Classes
  4. Types & Grammar
  5. Sync & Async
  6. ES.Next & Beyond

Each book is available in markdown format and can be read directly on GitHub or downloaded for offline reading.

Competitor Comparisons

Modern JavaScript Tutorial

Pros of javascript.info

  • More comprehensive coverage of modern JavaScript features and APIs
  • Interactive code examples and tasks for hands-on learning
  • Regular updates to keep content current with latest ECMAScript specifications

Cons of javascript.info

  • Less in-depth exploration of JavaScript's core concepts and mechanisms
  • Fewer advanced topics and edge cases covered
  • More focused on practical application rather than theoretical understanding

Code Comparison

You-Dont-Know-JS example (exploring this binding):

function foo() {
  console.log(this.a);
}
var obj = { a: 2, foo: foo };
obj.foo(); // 2

javascript.info example (exploring arrow functions):

let group = {
  title: "Our Group",
  students: ["John", "Pete", "Alice"],
  showList() {
    this.students.forEach(student => console.log(this.title + ': ' + student));
  }
};
group.showList();

Both repositories offer valuable resources for learning JavaScript, but they cater to different learning styles and depths of understanding. You-Dont-Know-JS delves deeper into the language's intricacies, while javascript.info provides a more practical, modern approach with interactive elements. The choice between them depends on the learner's goals and preferred learning method.

144,559

JavaScript Style Guide

Pros of JavaScript Style Guide

  • Provides a comprehensive set of rules for consistent JavaScript coding
  • Widely adopted in the industry, making it easier for developers to collaborate
  • Includes ESLint configurations for easy implementation

Cons of JavaScript Style Guide

  • Focuses primarily on syntax and style, rather than in-depth JavaScript concepts
  • May be too opinionated for some developers or projects
  • Requires regular updates to keep up with evolving JavaScript features

Code Comparison

You-Dont-Know-JS example (explaining closures):

function outer() {
  var x = 10;
  function inner() {
    console.log(x);
  }
  return inner;
}

JavaScript Style Guide example (demonstrating naming conventions):

const DAYS_IN_WEEK = 7;
const daysInMonth = 30;

function calculateDays(weeks) {
  return DAYS_IN_WEEK * weeks;
}

Summary

You-Dont-Know-JS is an in-depth series of books about JavaScript concepts, while JavaScript Style Guide is a set of coding standards. The former is ideal for learning JavaScript thoroughly, while the latter is better for establishing consistent coding practices across teams or projects. Both repositories serve different purposes and can be complementary in a developer's journey to mastering JavaScript.

:bathtub: Clean Code concepts adapted for JavaScript

Pros of Clean Code JavaScript

  • Focuses on practical coding principles and best practices
  • Provides concise, easy-to-understand examples
  • Covers a wide range of topics relevant to modern JavaScript development

Cons of Clean Code JavaScript

  • Less in-depth coverage of JavaScript fundamentals
  • May not be as suitable for beginners learning the language from scratch
  • Lacks the comprehensive, book-like structure of You Don't Know JS

Code Comparison

Clean Code JavaScript example:

// Bad
const locations = ['Austin', 'New York', 'San Francisco'];
locations.forEach((l) => {
  doStuff();
  doSomeOtherStuff();
  // ...
  // ...
  // ...
  dispatch(l);
});

// Good
const locations = ['Austin', 'New York', 'San Francisco'];
locations.forEach((location) => {
  doStuff();
  doSomeOtherStuff();
  dispatch(location);
});

You Don't Know JS example:

var a = [1,2,3];

var b = a.map(function(v){
    return v * 2;
});

b;      // [2,4,6]

Clean Code JavaScript focuses on practical coding style and best practices, while You Don't Know JS delves deeper into language mechanics and concepts. The code examples reflect this difference, with Clean Code JavaScript emphasizing readability and naming conventions, and You Don't Know JS demonstrating specific language features.

📜 33 JavaScript concepts every developer should know.

Pros of 33-js-concepts

  • Concise overview of key JavaScript concepts
  • Includes links to external resources for deeper learning
  • Covers modern JavaScript features and best practices

Cons of 33-js-concepts

  • Less in-depth explanations compared to You-Dont-Know-JS
  • May not cover advanced topics as thoroughly
  • Relies heavily on external resources, which may become outdated

Code Comparison

33-js-concepts:

// Example of closures
function outer() {
  const x = 10;
  function inner() {
    console.log(x);
  }
  return inner;
}

You-Dont-Know-JS:

// Example of closures
function foo() {
  var a = 2;
  function bar() {
    console.log(a);
  }
  return bar;
}
var baz = foo();
baz(); // 2

Both repositories provide valuable resources for learning JavaScript, but they differ in their approach. 33-js-concepts offers a more condensed overview with links to external resources, making it suitable for quick reference and guided learning. You-Dont-Know-JS, on the other hand, provides more in-depth explanations and covers advanced topics more thoroughly, making it ideal for developers seeking a deeper understanding of JavaScript concepts.

The code examples demonstrate that both repositories cover similar concepts, but You-Dont-Know-JS tends to provide more detailed explanations and practical examples. Ultimately, the choice between the two depends on the learner's preferences and learning style.

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

Pros of javascript-algorithms

  • Focuses on practical implementation of algorithms and data structures
  • Provides ready-to-use code examples for common programming challenges
  • Includes explanations and complexity analysis for each algorithm

Cons of javascript-algorithms

  • Less comprehensive coverage of JavaScript language fundamentals
  • May not delve as deeply into advanced JavaScript concepts
  • Primarily code-focused, with less emphasis on theoretical explanations

Code Comparison

You-Dont-Know-JS example (explaining closures):

function outer() {
  var x = 10;
  function inner() {
    console.log(x);
  }
  return inner;
}

javascript-algorithms example (implementing bubble sort):

function bubbleSort(arr) {
  for (let i = 0; i < arr.length; i++) {
    for (let j = 0; j < arr.length - i - 1; j++) {
      if (arr[j] > arr[j + 1]) {
        [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
      }
    }
  }
  return arr;
}

While You-Dont-Know-JS focuses on explaining JavaScript concepts in-depth, javascript-algorithms provides practical implementations of algorithms. The former is better for understanding JavaScript's intricacies, while the latter is more suitable for learning common programming algorithms and data structures using JavaScript.

A long list of (advanced) JavaScript questions, and their explanations :sparkles:

Pros of javascript-questions

  • Interactive format with questions and answers, promoting active learning
  • Covers a wide range of JavaScript concepts in bite-sized chunks
  • Regularly updated with new questions and community contributions

Cons of javascript-questions

  • Less in-depth explanations compared to You-Dont-Know-JS
  • May not cover advanced topics as thoroughly
  • Lacks the structured, book-like approach of You-Dont-Know-JS

Code Comparison

You-Dont-Know-JS often provides more detailed code examples:

function foo() {
    console.log(this.a);
}
var obj = { a: 2, foo: foo };
obj.foo(); // 2

javascript-questions typically uses shorter snippets:

const shape = {
  radius: 10,
  diameter() {
    return this.radius * 2;
  },
};

console.log(shape.diameter());

Both repositories offer valuable resources for learning JavaScript, but they cater to different learning styles and depths of understanding. You-Dont-Know-JS provides a comprehensive, in-depth exploration of JavaScript concepts, while javascript-questions offers a more interactive, quiz-like approach to reinforce knowledge and test understanding.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

You Don't Know JS Yet (book series) - 2nd Edition

This is a series of books diving deep into the core mechanisms of the JavaScript language. This is the second edition of the book series:

     ...

To read more about the motivations and perspective behind this book series, check out the Preface.

If you're looking for the previous first edition books, they can be found here.

Titles

I recommend reading the second edition books in this order:

If you're looking for the previous first edition books, they can be found here.

Publishing

As always, you'll be able to read these books online here entirely for free.

This edition of the books is being self-published through GetiPub publishing. The published books will be made available for sale through normal book retail sources.

If you'd like to contribute financially towards the effort (or any of my other OSS efforts) aside from purchasing the published books, please consider these options:

Contributions

Please feel free to contribute to the quality of this content by submitting PRs for improvements to code snippets, explanations, etc. While typo fixes are welcomed, they will likely be caught through normal editing/publishing processes, so please don't worry about them right now.

Any contributions you make to this effort are of course greatly appreciated.

But PLEASE read the Contributions Guidelines carefully before submitting a PR.

Thank You To These Wonderful Sponsors

Frontend Masters Logo (dark)

Frontend Masters Logo (light)

The first two books of the second edition are exclusively sponsored by Frontend Masters.

Frontend Masters is the gold standard for top-of-the-line expert training material in frontend-oriented software development. With over 150 courses on all things frontend, this should be your first and only stop for quality video training on HTML, CSS, JS, and related technologies.

Note: I teach all my workshops exclusively through Frontend Masters. If you like this book content, please check out my video training courses.

I want to extend a warm and deep thanks to Marc Grabanski and the entire Frontend Masters team, not only for their excellent work with the video training platform, but for their unwavering support of me and of the "You Don't Know JS" books!


License & Copyright

The materials herein are all © 2019-2022 Kyle Simpson.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 4.0 Unported License.