I have a javascript function which takes two arguments. First one is necessary and the second one is optional. The second argument is a callback function. How do I provide callback function as a default argument. The code that I wrote had errors. The code that I tried:
function doSomething(count,() => {}) {
//code
}
undefined. like mentioned below.undefined.