3
theuser
11d

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
  • 5
    Js...
    compile time...
    ...
    What parallel universe is it?
  • 2
    @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
    I'd like to know how const is getting changed.
  • 0
    @norman70688 Technically not, it gets its value from a list of strings which should've been a list of numbers.
  • 2
    @theuser does JS give a damn about if it's a number or a string? Dynamic typing FTW (I hate it!).
  • 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.
Your Job Suck?
Get a Better Job
Add Comment