JavaScript versprechen Multi -Funktionsfehler
function _inital_promise(calback) {
return (message) => {
return (boolean) => {
return new Promise((resolve,reject)=>{
try {
throw new Error(); // error
return resolve(message);
} catch (error) {
if (boolean) {
reject(error);
}else {
reject("something went wrong");
}
}
}).then(calback);
}
}
}
_inital_promise(console.log)("test")(false).catch(err=>console.log(err));
Powerful Pigeon