7
Dacexi
7y

Someone please tell me why react sees if(x = y) as valid js. That typo basically broke my app for 3 weeks and I didn't figure it out untill now. It set all my states to the same value. Fuck me 😑

Comments
  • 8
    Even for C it is valid. You are assigning y to x and this will return true if it can do the assignment.
  • 5
  • 3
    Get a linter!
  • 0
    Yes lint lint lint
  • 3
    @AlexDeLarge @math-silva yeah sorry. I realized that. Was just really angry at myself after solving this bug. It made my project compleatly broken for 3 weeks.
  • 3
    @Hedgepig @Ashkin @JohnDoesNot I though I had a longer but apparently it broke when I updated eslint :/
  • 1
    Ah sad times @Dacexi
  • 1
    And no need to apologise! It was your pain
  • 2
    @Hedgepig at least i'm making progress now :) I'm making a custom teamspeak client with a more modern UI and a better chat.
  • 0
    Nice, electron?
  • 1
    @Hedgepig i'm a 15 year old who uses VS Code and i've been coding 80% JS my whole life. I think you can work that out yourself 😜
  • 0
    Fair! I think I was about 15 when I first programmed and JS was my first language. Though I mainly tinkered about, didn't actually do anything like work on a TS client.

    Also js was pretty different then
  • 1
    @Hedgepig yeah I can imagine. I started with Java at age 6 but it didn't really stick so I started learning python. Did a couple text games for like 2 years then I moved to html. About 1 year after I learnt php and then js. (I know I started young, I have my uncle to thank for that ❤)
  • 1
    @Hedgepig oh yeah, and I'm currently learning c++.
  • 1
    @Dacexi wow man, yeah, hopefully I can help my kids. I didn't have anyone and Internet was relatively new. Nothing like stack overflow was around.

    It's a good time to be 15 and learning programming. So many options.
  • 0
    it's valid JS, resolving to true if the value could be set... get eslint!
  • 3
    @kb88 yeah check my previous comments. I was just dumb and frustrated 8n the heat of the moment :)
  • 1
    @Dacexi sorry, just have been replying to the OP (or OR in this case😂)
  • 1
    @AlexDeLarge thanks, good to know😊
Add Comment