The onFulfilled and onRejected Functions

Write a function, handleSuccess() . You’ll use this function later on as your success handler. handleSuccess() should have one parameter, representing a resolved value. Inside the body of handleSuccess() , log the parameter to the console.

const handleSuccess = (resolvedValue) => {

console.log(resolvedValue);

}

it is showing me error! can anyone tell me why or what am I doing wrong)

What does the error say? Do they want you to declare the function differently?

the error says syntax error all the time.

if (ordersunglasses > 0); ( is at least 1 syntax error. Is it giving you specific lines?

noh ! that line code is already its giving correct but the next line code of making handleSuccess function is showing syntax error.

If you’re syntax is fine before it, maybe it just wants value as a variable name??

I would do these checks: comment out your handleSuccess function and see if there’s a syntax error in the compiler (not the validator) before it. If there isn’t, it might be something the validator wants you to specifically do. It doesn’t hurt to “see solution” take note of the difference, and judge whether it was an important difference or not. Take note of it if it was.

thank you very much. I did see the solution because I was stuck there for one hour already. Thank you for quick response.

Hi can someone please help me understand why i am not passing task 2 please:

const order = [[‘sunglasses’, 1], [‘bags’, 2]];

// Write your code below:
function checkInventory(resolve, reject){
if(order.sunglasses > 0 && order.bags > 0){
resolve(“Thank you. Your order was successful.”)
}else{
reject(“We’re sorry. Your order could not be completed because some items are sold out”)
}
};

const handleSuccess = (resolvedValue) => {
console.log(resolvedValue);
};