Below is the structure of a method I have:
const a = function (...args: any[]) {
console.log(args);
}
In this function, the type of args
is any[]
. I am looking to create a specific type for the array of arguments accepted by this method in Typescript.
How can I achieve creating a specific type for the arguments accepted by this method?
NOTE: The function a
can accept various types of arguments such as
a(1, 2, 4, 5, 'asgasg', 124.52, { name: 'sparsh' });
I am aiming to define a specific type for the arguments allowed by the method in Typescript.