Typescript: "expected x arguments, but got y" error
Example:
function add(a: number, b: number) {
return a + b;
}
add(1);
This error is raised when the wrong number of arguments is passed to a function.
Solution:
add(1, 2);
Example: Solution:Typescript: "expected x arguments, but got y" error
This error is raised when the wrong number of arguments is passed to a function.
function add(a: number, b: number) {
return a + b;
}
add(1);
add(1, 2);