I have the below function:
function makeAnimal(
animal: string,
color: string,
age: number = 3,
gender: string = 'male'
name: string = 'Barky'
){
// some code
}
When I call this function, I do:
console.log(makeAnimal(
'dog',
'black'
3,
'male',
'Marky'
))
Is there an easier / cleaner way to call this function where I will just provide animal, color and name and no longer manually needing to provide age and gender?