3
theuser
1y

Fuck me, I must be trippin' some js balls. I have a number const which gets yanked out from a number[] and then compared in a find method. Trouble is, the const is somehow turned into a string at compile time.

Comments
  • 1
    @irene Alright, lets call it runtime/interpreted then. However, I do believe browsers uses JIT to compile js to bytecode, but don't quote me on that.

    also: nice snarky response good sir
  • 0
    @norman70688 Technically not, it gets its value from a list of strings which should've been a list of numbers.
  • 0
    @irene Why yes, if you use strict equality (===)
  • 1
    > Trouble is, the const is somehow turned into a string at compile time

    I'm 99% sure that whatever is happening it's not this but rather something you did (which you didn't show btw)
  • 0
    Auto type coercion.
Add Comment