JavaScript

Notes

  • How sorting in JavaScript worksHow sorting in JavaScript works
    A direct answer to this question is "it depends". This is because JavaScript is actually a specification. The actual implementation of sorting depends on the JavaScript engine.

    For example, Google...
  • Hoisting in JavaScriptHoisting in JavaScript
    JavaScript interpreters makes two passes over code.

    In the first pass, the interpreter hoists variables and functions (i.e. moves declarations to the top of the scope).

    The instructions in the co...
  • Optional chaining operator in JavaScriptOptional chaining operator in JavaScript
    The optional chaining operator (?.) can be used to access the following:

    Properties (foo?.bar)
    Indexes (foo?.[1])
    Functions (foo?.())


    Examples:

    const foo = {
    bar: 'baz',
    ping: {
    ...

Quotes

#quote

Sometimes when I’m writing JavaScript I want to throw up my hands and say "this is bullshit!" but I can never remember what "this" refers to.

– Ben Halpern