You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'.
in which the value "foo" is used as type.
Minimal reproduction
$ npx ts-node
> const x = 10
undefined
> const y = 'foo'
undefined
> function add(x: number, y: number) { return x + y }
undefined
> add(x, y)
<repl>.ts:7:8 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
7 add(x, y)
~
The text was updated successfully, but these errors were encountered:
Search Terms
TS2345
screenshot
Expected Behavior
Actual Behavior
The screenshot on website () shows
in which the value
"foo"
is used as type.Minimal reproduction
The text was updated successfully, but these errors were encountered: