SlideShare a Scribd company logo
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
toString().padStart(width) : cell.padEnd(width); }).join(''))).join
}; const proportion = (max, val) => Math.round(val * 100 / max); co
calcProportion = table => { table.sort((row1, row2) => row2[DENSITY
row1[DENSITY_COL]); const maxDensity = table[0][DENSITY_COL]; table
forEach(row => { row.push(proportion(maxDensity, row[DENSITY_COL]))
return table; }; const getDataset = file => { const lines = fs.read
FileSync(file, 'utf8').toString().split('n'); lines.shift(); lines
return lines.map(line => line.split(',')); }; const main = compose
(getDataset, calcProportion, renderTable); const fs = require('fs'
compose = (...funcs) => x => funcs.reduce((x, fn) => fn(x), x); con
DENSITY_COL = 3; const renderTable = table => { const cellWidth = [
8, 8, 18, 6]; return table.map(row => (row.map((cell, i) => { const
= cellWidth[i]; return i ? cell.toString().padStart(width) : cell.p
(width); }).join(''))).join('n'); }; const proportion = (max, val)
Новое в JavaScript
ES.Next, ECMAScript 2020
Тимур Шемсединов
github.com/HowProgrammingWorks
Chief Software Architect at Metarhia
Lecturer at Kiev Polytechnic Institute
github.com/tshemsedinov
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
ECMA Script versions
ES1 Jun 1997 ES6 ES2015
ES2 Jun 1998 ES7 ES2016
ES3 Dec 1999 ES8 ES2017
ES5 Dec 2009 ES9 ES2018
ES5.1 Jun 2011 ES10 ES2019
ES11 ES2020
ES.Next
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Links
ES2020 https://tc39.es/ecma262/
Node Green https://node.green/
Proposals https://github.com/tc39/proposals
Can I use https://caniuse.com/
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Array
Array.prototype.includes(value[, fromIndex])
Array.prototype.flat([depth])
Array.prototype.flatMap(callback[, thisArg])
Array.prototype.sort([compareFunction])
QuickSort to TimSort
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Object
Object.values(object)
Object.keys(object)
Object.entries(object)
Object.fromEntries(object)
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
String
String.prototype.padStart(targetLength [, padString])
String.prototype.padEnd(targetLength [, padString])
String.prototype.trimStart()
String.prototype.trimEnd()
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Operators
Rest
const f = (a, b, ...array) => {};
const g = ({ a, b, ...array }) => {};
const { name, ...rest } = obj;
Spread
f(a, b, ...array);
const obj2 = { name, ...obj1 };
const clone = { ...obj };
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Operators
Exponentiation
Math.pow(x, y) x ** y x **= y x = x ** y
Optional chaining
const spqr = {
emperor: { name: 'Marcus' }
};
console.log(spqr.emperor?.name);
console.log(spqr.president?.name);
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Asynchronous function: async/await
const fn = async (a, b, c) => {
// do something
await callSomething();
// do something
return aValue;
};
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Trailing commas
const fn = (arg1, arg2, arg3,) => {
console.log({
arg1,
arg2,
arg3,
});
};
fn(...['val1', 'val2', ], 'val3',);
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Asynchronous iterable contract
Symbol.iterator
iterable[Symbol.iterator]()
Symbol.asyncIterator
asyncIterable[Symbol.asyncIterator]()
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Try...catch
try {
throw new Error('message');
} catch {
console.log('no arguments catched');
}
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Function
((a, b) => {
const c = a + b; // hello there
return c;
}).toString()
"(a, b) => {
const c = a + b; // hello there
return c;
}"
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Symbol
const sym = Symbol('description');
console.log(sym);
// Symbol(description);
console.log(sym.description);
// description
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Promise.finally
new Promise(executor)
.then(onFulfilled[, onRejected])
.catch(onRejected)
.finally(onFinally);
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Promise.allSettled
const p1 = Promise.resolve('p1');
const p2 = new Promise((resolve, reject) => {
setTimeout(resolve, 1000, 'p2');
});
const p3 = new Promise((resolve, reject) => {
setTimeout(reject, 100, 'p3');
});
Promise.all([p1, p2, p3]).then(values => {
console.log(values);
});
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Promise.allSettled
Promise.all([p1, p2, p3]).then(values => {
console.log(values);
});
node:26549) UnhandledPromiseRejectionWarning: p3
(node:26549) UnhandledPromiseRejectionWarning: Unhandled promise
rejection. This error originated either by throwing inside of an
async function without a catch block, or by rejecting a promise
which was not handled with .catch(). (rejection id: 1)
(node:26549) [DEP0018] DeprecationWarning: Unhandled promise
rejections are deprecated. In the future, promise rejections that
are not handled will terminate the Node.js process with
a non-zero exit code.
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Promise.allSettled
const p1 = Promise.resolve('p1');
const p2 = new Promise((resolve, reject) => {
setTimeout(resolve, 1000, 'p2');
});
const p3 = new Promise((resolve, reject) => {
setTimeout(reject, 100, 'p3');
});
Promise.allSettled([p1, p2, p3]).then(values => {
console.log(values);
});
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
Promise.allSettled
Promise.allSettled([p1, p2, p3]).then(values => {
console.log(values);
});
[
{ status: 'fulfilled', value: 'p1' },
{ status: 'fulfilled', value: 'p2' },
{ status: 'rejected', reason: 'p3' }
]
const fs = require('fs'); const compose = (...funcs) => x => funcs.
reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab
table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma
=> (row.map((cell, i) => { const width = cellWidth[i]; return i ? c
More features
Atomics
SheredArrayBuffer
Set, Map, WeakSet, WeakMap
globalThis
Private fields
Static fields

More Related Content

PDF
Node.js in 2020 - part 1
PDF
How are Race Conditions in single threaded JavaScript possible?
PDF
Node.js in 2020 - part 3
PDF
Введение в SQL
PDF
Race-conditions-web-locks-and-shared-memory
PDF
Node.js in 2020
PDF
Patterns and antipatterns
PDF
Node.js in 2020 - part 2
Node.js in 2020 - part 1
How are Race Conditions in single threaded JavaScript possible?
Node.js in 2020 - part 3
Введение в SQL
Race-conditions-web-locks-and-shared-memory
Node.js in 2020
Patterns and antipatterns
Node.js in 2020 - part 2

What's hot (20)

PDF
Web Locks API
PDF
Prototype programming in JavaScript
PDF
Serverless Clouds (FaaS) and request context isolation in Node.js
PDF
Programming Languages: comparison, history, future
PDF
Private cloud without vendor lock // Serverless
PDF
JavaScript в браузере: Web API (часть 1)
PDF
How to keep control and safety in the clouds
PDF
Asynchronous programming and mutlithreading
PDF
Asynchronous programming with java script and node.js
PDF
Node.js middleware: Never again!
PDF
Metarhia KievJS 22-Feb-2018
PDF
JS Fest 2019 Node.js Antipatterns
PDF
Duralexsedregex
PDF
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
PPTX
Building HTML5 enabled web applications with Visual Studio 2011
PDF
Bytes in the Machine: Inside the CPython interpreter
PPTX
Python Tidbits
DOCX
PDF
Python sqlite3
Web Locks API
Prototype programming in JavaScript
Serverless Clouds (FaaS) and request context isolation in Node.js
Programming Languages: comparison, history, future
Private cloud without vendor lock // Serverless
JavaScript в браузере: Web API (часть 1)
How to keep control and safety in the clouds
Asynchronous programming and mutlithreading
Asynchronous programming with java script and node.js
Node.js middleware: Never again!
Metarhia KievJS 22-Feb-2018
JS Fest 2019 Node.js Antipatterns
Duralexsedregex
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
Building HTML5 enabled web applications with Visual Studio 2011
Bytes in the Machine: Inside the CPython interpreter
Python Tidbits
Python sqlite3
Ad

More from Timur Shemsedinov (15)

PDF
How to use Chat GPT in JavaScript optimizations for Node.js
PDF
IT Revolution in 2023-2024: AI, GPT, business transformation, future professi...
PDF
Multithreading in Node.js and JavaScript
PDF
Node.js threads for I/O-bound tasks
PDF
Node.js Меньше сложности, больше надежности Holy.js 2021
PDF
Rethinking low-code
PDF
Hat full of developers
PDF
FwDays 2021: Metarhia Technology Stack for Node.js
PDF
Node.js for enterprise - JS Conference
PDF
Node.js for enterprise 2021 - JavaScript Fwdays 3
PDF
Node.js in 2021
PDF
Information system structure and architecture
PDF
Базы данных в 2020
PDF
Почему хорошее ИТ-образование невостребовано рыночком
PDF
Node.js security
How to use Chat GPT in JavaScript optimizations for Node.js
IT Revolution in 2023-2024: AI, GPT, business transformation, future professi...
Multithreading in Node.js and JavaScript
Node.js threads for I/O-bound tasks
Node.js Меньше сложности, больше надежности Holy.js 2021
Rethinking low-code
Hat full of developers
FwDays 2021: Metarhia Technology Stack for Node.js
Node.js for enterprise - JS Conference
Node.js for enterprise 2021 - JavaScript Fwdays 3
Node.js in 2021
Information system structure and architecture
Базы данных в 2020
Почему хорошее ИТ-образование невостребовано рыночком
Node.js security
Ad

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
medical staffing services at VALiNTRY
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Introduction to Artificial Intelligence
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
medical staffing services at VALiNTRY
Which alternative to Crystal Reports is best for small or large businesses.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Odoo Companies in India – Driving Business Transformation.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
ISO 45001 Occupational Health and Safety Management System
Upgrade and Innovation Strategies for SAP ERP Customers
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Introduction to Artificial Intelligence
PTS Company Brochure 2025 (1).pdf.......
How to Migrate SBCGlobal Email to Yahoo Easily
How Creative Agencies Leverage Project Management Software.pdf
ManageIQ - Sprint 268 Review - Slide Deck
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ai tools demonstartion for schools and inter college
2025 Textile ERP Trends: SAP, Odoo & Oracle
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms II-SECS-1021-03

Новое в JavaScript: ES.Next, ECMAScript 2020, ES11, ES10, ES9, ES8, ES7, ES6, ES2020, ES2019

  • 1. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c toString().padStart(width) : cell.padEnd(width); }).join(''))).join }; const proportion = (max, val) => Math.round(val * 100 / max); co calcProportion = table => { table.sort((row1, row2) => row2[DENSITY row1[DENSITY_COL]); const maxDensity = table[0][DENSITY_COL]; table forEach(row => { row.push(proportion(maxDensity, row[DENSITY_COL])) return table; }; const getDataset = file => { const lines = fs.read FileSync(file, 'utf8').toString().split('n'); lines.shift(); lines return lines.map(line => line.split(',')); }; const main = compose (getDataset, calcProportion, renderTable); const fs = require('fs' compose = (...funcs) => x => funcs.reduce((x, fn) => fn(x), x); con DENSITY_COL = 3; const renderTable = table => { const cellWidth = [ 8, 8, 18, 6]; return table.map(row => (row.map((cell, i) => { const = cellWidth[i]; return i ? cell.toString().padStart(width) : cell.p (width); }).join(''))).join('n'); }; const proportion = (max, val) Новое в JavaScript ES.Next, ECMAScript 2020 Тимур Шемсединов github.com/HowProgrammingWorks Chief Software Architect at Metarhia Lecturer at Kiev Polytechnic Institute github.com/tshemsedinov
  • 2. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c ECMA Script versions ES1 Jun 1997 ES6 ES2015 ES2 Jun 1998 ES7 ES2016 ES3 Dec 1999 ES8 ES2017 ES5 Dec 2009 ES9 ES2018 ES5.1 Jun 2011 ES10 ES2019 ES11 ES2020 ES.Next
  • 3. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Links ES2020 https://tc39.es/ecma262/ Node Green https://node.green/ Proposals https://github.com/tc39/proposals Can I use https://caniuse.com/
  • 4. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Array Array.prototype.includes(value[, fromIndex]) Array.prototype.flat([depth]) Array.prototype.flatMap(callback[, thisArg]) Array.prototype.sort([compareFunction]) QuickSort to TimSort
  • 5. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Object Object.values(object) Object.keys(object) Object.entries(object) Object.fromEntries(object)
  • 6. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c String String.prototype.padStart(targetLength [, padString]) String.prototype.padEnd(targetLength [, padString]) String.prototype.trimStart() String.prototype.trimEnd()
  • 7. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Operators Rest const f = (a, b, ...array) => {}; const g = ({ a, b, ...array }) => {}; const { name, ...rest } = obj; Spread f(a, b, ...array); const obj2 = { name, ...obj1 }; const clone = { ...obj };
  • 8. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Operators Exponentiation Math.pow(x, y) x ** y x **= y x = x ** y Optional chaining const spqr = { emperor: { name: 'Marcus' } }; console.log(spqr.emperor?.name); console.log(spqr.president?.name);
  • 9. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Asynchronous function: async/await const fn = async (a, b, c) => { // do something await callSomething(); // do something return aValue; };
  • 10. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Trailing commas const fn = (arg1, arg2, arg3,) => { console.log({ arg1, arg2, arg3, }); }; fn(...['val1', 'val2', ], 'val3',);
  • 11. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Asynchronous iterable contract Symbol.iterator iterable[Symbol.iterator]() Symbol.asyncIterator asyncIterable[Symbol.asyncIterator]()
  • 12. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Try...catch try { throw new Error('message'); } catch { console.log('no arguments catched'); }
  • 13. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Function ((a, b) => { const c = a + b; // hello there return c; }).toString() "(a, b) => { const c = a + b; // hello there return c; }"
  • 14. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Symbol const sym = Symbol('description'); console.log(sym); // Symbol(description); console.log(sym.description); // description
  • 15. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Promise.finally new Promise(executor) .then(onFulfilled[, onRejected]) .catch(onRejected) .finally(onFinally);
  • 16. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Promise.allSettled const p1 = Promise.resolve('p1'); const p2 = new Promise((resolve, reject) => { setTimeout(resolve, 1000, 'p2'); }); const p3 = new Promise((resolve, reject) => { setTimeout(reject, 100, 'p3'); }); Promise.all([p1, p2, p3]).then(values => { console.log(values); });
  • 17. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Promise.allSettled Promise.all([p1, p2, p3]).then(values => { console.log(values); }); node:26549) UnhandledPromiseRejectionWarning: p3 (node:26549) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:26549) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  • 18. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Promise.allSettled const p1 = Promise.resolve('p1'); const p2 = new Promise((resolve, reject) => { setTimeout(resolve, 1000, 'p2'); }); const p3 = new Promise((resolve, reject) => { setTimeout(reject, 100, 'p3'); }); Promise.allSettled([p1, p2, p3]).then(values => { console.log(values); });
  • 19. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c Promise.allSettled Promise.allSettled([p1, p2, p3]).then(values => { console.log(values); }); [ { status: 'fulfilled', value: 'p1' }, { status: 'fulfilled', value: 'p2' }, { status: 'rejected', reason: 'p3' } ]
  • 20. const fs = require('fs'); const compose = (...funcs) => x => funcs. reduce((x, fn) => fn(x), x); const DENSITY_COL = 3; const renderTab table => { const cellWidth = [18, 10, 8, 8, 18, 6]; return table.ma => (row.map((cell, i) => { const width = cellWidth[i]; return i ? c More features Atomics SheredArrayBuffer Set, Map, WeakSet, WeakMap globalThis Private fields Static fields