0

構文エラーを示す以下のコードを解決するのを手伝ってください。確かに何か問題があることはわかっています。アロー関数を使用して、以下の 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;
};
4

1 に答える 1