ES6: Create a JavaScript Promise

This is the answer:

const makeServerRequest = new Promise((resolve, reject) => {

})

This doesn’t work:

const makeServerRequest = new Promise ((resolve, reject) => {

})

I’m not sure why it works vs doesn’t with the space vs not… Please tell me why?

Thanks!

This is the question:

Create a new promise called makeServerRequest . Pass in a function with resolve and reject parameters to the constructor.

I’m pretty sure your code is valid. Sometimes FCC validation can be a bit picky, for example a challenge might require you to return the string ‘Hello World!’ but if you enter ‘hello world!’ you would get an error. The original code should work in a normal environment.

1 Like

Okay, and thanks. I know no system is perfect… I was just really confused because I’m still learning and wasn’t sure if the space meant something or not.

What I’m trying to say is thank you