DEV Community

Pere Sola
Pere Sola

Posted on • Edited on

[WIP] You Don't Know JavaScript. Glossary.

You Don't Know Javascript by Kyle Simpson is a good series of books to deep dive into the language. There are a lot of words that I hear again and again, this is a repository of definitions that I find useful.

  • Coercion: Converting from one value type to another, such as from string to number, is referred to in JS as "coercion."
  • const: can be re-assigned but not mutated.
  • Function declaration: it appears as a statement by itself, not as an expression in another statement. The association between the identifier and the function value happens during the compile phase of the code, before that code is executed..
  • Function expression: This function is an expression that is assigned to the variable. Different from the function declaration form, a function expression is not associated with its identifier until that statement during runtime..
  • Let vs var: let allows a more limited access to the variable than var. This is called "block scoping" as opposed to regular or function scoping.
  • Literals: in JS programs, values can either appear as literal values (as many of the preceding examples illustrate), or they can be held in variables; think of variables as just containers for values.
  • Primitive values: string, boolean, number, bigint, null, undefined and symbol.
  • Values: most fundamental unit of value. Values are data. They're how the program maintains state. Values come in two forms in JS: primitive and object. Primitives are held by value. Objects are held by reference..
  • var vs let: The let keyword has some differences to var, with the most obvious being that let allows a more limited access to the variable than var. This is called "block scoping" as opposed to regular or function scoping. (...) But var is still useful in that it communicates "this variable will be seen by a wider scope (of the whole function)". Both declaration forms can be appropriate in any given part of a program, depending on the circumstances.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript UI Library for Surveys and Forms

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

View demo

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay