let doSmth = () => {
return new Promise((resolve, reject) => {
if (Math.random() > 0.5) {
resolve('doSmth success');
}
else
{
reject('doSmth Fail');
}
});
}
let doSmthElse = async () => {
return await new Promise((resolve, reject) => {
if (Math.random() > 0.5) {
resolve('doSmthElseSuccess')
}
else
{
reject('doSmthElseFail');
}
})
}
// -- CHAIN
(async () => {
try {
let resSmth = await doSmth();
console.log('res = ' + resSmth);
let resSmthElse = await doSmthElse();
console.log('resSmthElse = ' + resSmthElse);
} catch (e) {
console.log(e);
}
})();
-
MY PROJECTS
-
Recent Posts
- Database.Middle.What are surroget keys ?
- Database.Middle.Explain the difference between OLTP and OLAP.
- Database.Middle.Partitions and sharding, differenes
- Database.Middle.do i see different tables in some sql explorer like dataGrip, for example ?
- Database.Middle.How does database partitioning work?
- Database.Middle.What is a trigger? How and when would you use it?
- Database.Middle.What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK()?
- Database.Middle.What are CTEs (Common Table Expressions)?
- Database.Middle.If i don’t use ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, so i take all rows ?
- Database.Middle.WindowFunctions.Explain ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
- Database.Total.Give examples with Sum(), Avg(), Max()
- Database.Middle.What is window function?
- Database.Middle.Pagination.SeekMethod.What if some rows were deleted ?
- Database.Middle.Why, when we seek for pages no shifting from inserts/deletes on other rows ?
- Database.Middle.What is the Seek Method?
- Database.Middle.How would you implement pagination in SQL?
- Database.Middle.What is eventual consistency?
- Database.Middle.Explain the concept of sharding in databases.
- Database.Middle.MaterializedView
- Database.Middle.How can you detect and resolve deadlocks?
Categories
- Aptana
- Azure
- C#
- DataSnap
- DBExpress
- Delphi
- Delphi и сети
- Delphi. Язык программирования
- ExtJS
- FastReport
- FireDAC
- FireMonkey
- GIT
- ICS
- IDE
- IIS
- Indy
- InnoSetup
- javascript
- jQuery
- JSON
- LiveBindings
- MSHTML
- MySQL
- PHP
- REST
- Ribbons
- SMS
- SQL инструкции
- SVN
- TRichView
- UniGui
- WebBroker
- WinAPI
- Windows
- Алгоритмы
- Без рубрики
- Деревья
- Ищу ответ
- Компонентостроение
- Мои компоненты
- Начальный уровень
- Обработка исключений
- Парсинг
- Потоки(Threads)
- Регулярные выражения
- Тестирование приложений