2
console.log([].concat(0, 123))

I've no clue what the error means

No overload matches this call.
  Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type '0' is not assignable to parameter of type 'ConcatArray<never>'.
  Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
    Argument of type '0' is not assignable to parameter of type 'ConcatArray<never>'.ts(2769)

I assign to a variable and declare any type I still see the error.

2
  • This console.log(([] as number[]).concat(0, 123)) works. Check: stackoverflow.com/a/54117175 for further information. Commented May 14, 2020 at 8:21
  • @Yoshi I was curious what keyword you searched? Commented May 14, 2020 at 9:57

1 Answer 1

1

Try this:

console.log(([] as any[]).concat(0, 123));

For more info, check this github issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.