SOURCE

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);
});
console 命令行工具 X clear

                    
>
console