Arrow function as a parameter

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

it is true that no variable is used, but the argument is passed in the same:

new Promise() whatever is inside the () is the argument(s) that are passed in

it is the same with any function and method, for example push

// you can do this
let num = 5
arr.push(num); // with variable

// you can do this
arr.push(6); // directly with the value 

so we can use functions as a parameter in another function ?

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 i

that I don’t know, my brief research didn’t come up with anything, but I do not have much time at the moment

but yes, you can pass functions in other functions, both in arrow function form and with function keyword, there is a whole family of methods that take functions as arguments (higher order functions) which you will learn about later in the curriculum