Skip to content

Instantly share code, notes, and snippets.

View Stepa4man's full-sized avatar

Stepan Furman Stepa4man

  • TechDivision
  • Germany
View GitHub Profile
@Stepa4man
Stepa4man / promises.js
Created December 9, 2021 13:30
Promises work like that
function change()
{
if (window.promise_test) {
window.promise_test.then(() => console.log('Second message'));
} else {
window.promise_test = new Promise(
function (resolve, reject) {
console.log('Show first message');
setTimeout(
() => {