Tell us what’s happening:
please can anybody help me i am having a confusion . how to pass a arrow function as a parameter in another function as in the below code a arrow function is passed as a parameter in the constructor which is also a function , as in prevoius coding challenge i have seen that the syntax for the arrow fucntion is
const arr = (par1,par2) = >{
};
in the below code no variable used , please help me it is creating a confusion
and my second doubt is that i have google that we cant use arrow function in the constructor , so how in the below code we are using it
Your code so far
const rahul = new Promise((resolve,reject) =>{
});
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
.
Challenge: Create a JavaScript Promise
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/create-a-javascript-promise