console.log(deepEqual(
{"test":{"name":"Misha","order":{"price":20}}},
{"test":{"order":{"price":20},"name":"Misha"}}
)); // true
console.log(deepEqual(
{"name":"Misha","order":{"price":20}},
{"name":"Misha","order":{"price":1000}}
)); // false
console.log(deepEqual(
{"name":"Misha","order":{"price":20,"count":1,"taxes":{"vat":{"name":"vat","amount":{"uah":10,"usd":0.37}}},"total":{"withoutTaxes":{"uah":20,"usd":0.74},"withTaxes":{"vat":{"uah":30,"usd":1.11}}}}},
{"name":"Misha","order":{"price":20,"count":1,"taxes":{"vat":{"name":"vat","amount":{"uah":10,"usd":0.37}}},"total":{"withoutTaxes":{"uah":20,"usd":575},"withTaxes":{"vat":{"uah":30,"usd":1.11,"eur":null}}}}}
)); // false
new Promise((resolve, reject) => { console.log('main'); resolve('main 1'); })
.catch((d) => { console.log('catch 1'); return `${d}, catch 1`; })
.then((d) => { console.log('then'); throw Error(d); });
// main
// then
// Uncaught (in promise) Error: main 1
new Promise((resolve, reject) => { console.log('main'); resolve('main 1'); })
.catch((d) => { console.log('catch 1'); return `${d}, catch 1`; })
.then((d) => { console.log('then'); throw Error(d); })
.catch((d) => { console.log('catch 2'); return `${d}, catch 2`; })
.then(
(d) => { console.log('then 2 resolve'); return `${d}, then 2 resolve`; },
(d) => { console.log('then 2 reject'); return `${d}, then 2 reject`; },
);
// main
// then
// catch 2
// then 2
// Promise { <state>: "fulfilled", <value>: "Error: main 1, catch 2, then 2 resolve" }