#Code works when running but the linter still screams error at me?
12 messages · Page 1 of 1 (latest)
You have a double array of numbers and you're trying to assign an array of numbers to it.
let a = [ [ 1, 2, 3 ], [ 1, 2, 3 ] ]
a = [ 1, 2, 3 ] // Type Error.
Also. _ is a horrible name for a variable. It is normally reserved in practice to prefix variables with _ that you want to declare but know aren't/won't being used in the code.
by the way, instead of using sort then reverse, you could just replace a - b with b - a
(and remove the .reverse() completely)
another thing, Deno ignores TS errors unless you provide the --check flag
which is somewhat good, you dont want to --check a huge production codebase every time - it would take too long (ts errors are treated more of a development concern)
Rust be like: Am I a joke to you
(lol I know TS/ Deno is not Rust)