Learn Intermediate JavaScript


I just can’t understand this page.

My answer was accepted for question #1. Below is my solution for question #1:

let prom = new promise ((resolve, reject) => { resolve( "Thank you. Your order was successful."); } else { reject(“We’re sorry. Your order could not be completed because some items are sold out”) }; }; });

but when I got to the second question, I had to use the ‘view solution’ option which has the answer as

const handleSuccess = (resolvedValue) => {

const handleFailure = (rejectReason) => {

.then(handleSuccess, handleFailure);

Unless I’m mistaken, there is no reference to the question #1 at all. Additionally, I don’t understand how I should use the ‘setTimeout()’ function mentioned in question #1.

Can someone please help me understand?

Thank you.

in step one they just explain to you what they’ve written in the file library.js. You should not write anything before step 2 – just look at their code. That’s what you get the check for.

1 Like

Oh Okay! Thank you so much!!

1 Like