帮我解决以下显示语法错误的代码。我知道肯定有问题。如何借助箭头函数编写以下 checkInventory 订单。
const {checkInventory} = require('./library.js');
const order = [['sunglasses', 0], ['bags', 2]];
const handleSuccess = (resolvedValue) => {
console.log(resolvedValue);
};
const handleFailure = (rejectReason) => {
console.log(rejectReason);
};
checkInventory(order)=new Promise(resolvedValue, rejectReason){
if(resolvedValue)
return handleSuccess;
else
return handleFailure;
};