N
N
netW0rm2016-03-16 10:01:23
JavaScript
netW0rm, 2016-03-16 10:01:23

How to suppress TypeScript error?

function foo(x: number, s?: string) {
  console.log(x, s)
}
function bar(x: number, ...args) {
  foo(...args) // компилятор ругается:  Supplied parameters do not match any signature of call target
}
bar(1, 3, 'ok')

I understand why it gives an error, but I need just such a function call.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EshBobrow, 2016-03-16
@EshBobrow

you can disable the noImplicitAny compiler option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question