Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alert('start');
- function fun(s, f) {
- alert('s : '+s);
- f();
- }
- fun('s1', function f1() {alert('1. Сработала первая функция.')});
- fun('s2', function f2() {function t(){alert('2. Сработала вторая функция.');};setTimeout(t, 1000)});
- fun('s3', function f3() {alert('3. Сработала третья функция.')});
- alert('stop');
- var p = new Promise(function(resolve, reject) {
- console.log('start');
- resolve();
- });
- p.then(function() { console.log('first func begin')});
- p.then(function() { console.log('second func begin')});
- p.then(function() { console.log('end')});
Add Comment
Please, Sign In to add comment