function timeout(ms) { return new Promise((resolve, reject) => { setTimeout(resolve, ms, 'done'); }); } var t = timeout(1000); console.log('t',t); timeout(1000).then((value) => { console.log(value); });