JavaScript
Updated: 2022-04-25
JavaScript standard: ECMA-262 (https://github.com/tc39/ecma262); a.k.a. ECMAScript.
New features: https://github.com/tc39/proposals/blob/master/finished-proposals.md
JavaScript Engines
Browser
- Chrome: V8
- Firefox: SpiderMonkey (the first JavaScript engine, originally used in Netscape Navigator) written in C++, Rust and JavaScript.
- Safari: Nitro
Beyond Browser
- Node.js: uses the Google V8 JavaScript engine to execute code.
Browser Object Model (BOM)
window
object is used to interact with the browser. The following object can be used directly or under window
, e.g. window.navigator
or navigator
document
: HTML DOMnavigator
: to get browser informationhistory
screen
location
: url, host, path, protocol (NOT the user location)
JavaScript Ecosystem
Most popular web frameworks
- React: developed and used by Facebook
- Angular: developed by Google
- Vue
Typecheck
- TypeScript: can be compiled to JavaScript
- better tooling: advanced autocompletion, navigation, and refactoring
- developed by Microsoft
- SUPERSET OF JAVASCRIPT, javascript code is also valid typescript code
- Flow: also developed by Facebook, so works fine with React
Other notable libs
- Babel: the compiler
- D3 / HighCharts: for data visualization
- Express.js: the node.js web framework
- WebPack: for apps
- Rollup: for libs
- Bootstrap: the CSS framework from Twitter.
- Lerna: build multiple packages from the same repo.
- ESLint: lint...
es6 backtick
Template literals can be used multi line and may use "interpolation" to insert the content of variables:
var a = 123,
str = `---
a is: ${a}
----`;
console.log(str);
Will output:
---
a is: 123
---
Integer
JavaScript does not have an integer type. JavaScript is only able to handle 52bit integers.