const printMyName = name => {console.log(name)};
let count = 0;
const getPromise = (seconds) => new Promise((resolve, reject)=>{
setTimeout(()=>{
resolve(printMyName(`ttest ${++count}`));
}, seconds * 1000)
});
console.log('---zero then---');
getPromise(1)
.then((res)=>{
console.log('---first then---');
return getPromise(2);
}).then((res)=>{
console.log('---second then---');
return getPromise(2);
}).then((res)=>{
console.log('---thrid then---');
return getPromise(2);
}).then((res)=>{
console.log('---forth then---');
});