i want to set an optional parameter to a function using javascript. i have a function defined like below,
const function1 = () => {
setValue(!open);
};
i call it like below in other function
const main_function = () => {
function1();
}
now i want to pass an optional parameter to function1 to accept an optional parameter that sets it to true or false instead of toggling based on previous value.
how can i fix this. could someone help me with this thanks.