function api(params){ setTimeout(function(){return 1},100) } const a = number => { return Promise(api(number) .then(res=>console.log(res))) } a(1);