Tin mới
Variables in JavaScript are declared using one of three keywords: let, const, or var.
JavaScript's numeric operators include +, -, *, /, % (remainder), and ** (exponentiation). Values are assigned using =. Each binary operator also has a compound assignment counterpart such as += and -=, which extend out
reference page for lexical grammar
JavaScript grammar is very similar to the C family. There are a few points worth mentioning:
JavaScript has a similar set of control structures to other languages in the C family. Conditional statements are supported by if and else; you can chain them together:
Inheritance and the prototype chain
JavaScript objects can be thought of as collections of key-value pairs. As such, they are similar to:
Along with objects, functions are the core component in understanding JavaScript. The most basic function declaration looks like this:
JavaScript is single-threaded by nature. There's no paralleling; only concurrency. Asynchronous programming is powered by an event loop, which allows a set of tasks to be queued and polled for completion.
Throughout this page, we've constantly mentioned that certain features are language-level while others are runtime-level.
IEEE 754 64-bit double-precision floating point value
JavaScript has two built-in numeric types: Number and BigInt.
Immediately invoked function expression (IIFE)
JavaScript lets you create anonymous functions — that is, functions without names. In practice, anonymous functions are typically used as arguments to other functions, immediately assigned to a variable that can be used