22
scroach
12d

alright... so thats how you parse JSON in javascript in 2019? i'm vomiting right now...

Comments
  • 4
    I'm sure there's also some fancy library and/or NPM package for that.
  • 10
    That's one way to do it.
    I mean... it's not how I would spend my day, but if it works....
  • 9
    bUt YoU cAn UsE iT oN bOtH bAcK aNd FrOnTeNd
  • 4
    No way, parsing in json in js is much easier than that
  • 2
    That what I usually see on my workplace legacy code
  • 3
    I'm going to have a nightmare about this.
  • 1
  • 3
    Lol that's deffo not how you parse JSON, prob done by someone who has no idea of even basic Javascript's internals..
  • 3
    Ok, looking at this closely, this is either a troll, or someone should not be allowed near a keyboard.

    I mean json.stringify( eval() ) who the fuck evals() a random sting.

    ANd then can't work our all this can be done with json.parse()

    🤨
  • 4
    I'd rather simply JSON.parse(); that, then use the created object...
  • 2
    Yeah that's not JavaScript. Some of the variable names start with $. Someone just came from PHP writing shitty WordPress plugins and has no fucking clue what they're doing
  • 3
    @AlgoRythm not true.
    Drop Jquery in and $xyz is a valid variable

    This is not a "needs more Jquery" comment 😂
  • 2
    Lol no, that is not how you parse JSON in 2019. Actually, that was not how you parsed JSON in 2012 to begin with.

    Its a hacky hack made to parse what he needed with strings instead of objects because whomever wrote it is a fucking moron :D
  • 1
    I feel anger towards this.
    And i also feel this anger is pretty old. Possibly the pain of wasted time ciphering through code such as this and "refactoring" it so i can continue with my life...

    We should be prepared for this in colleges just like doctors need to work on dead bodies in their training.
  • 2
    @AlgoRythm oh it is most definitely Javascript brochacho. The $ got me at first but the stringify and slicing methods are 100% JS stuff. this code is the stuff of nightmares when seeing it all over the place :P PTSD made it easy to spot haha
  • 1
    @AleCx04 It might *be* JavaScript, but that's no damn JavaScript.
  • 1
    No, this is a CS student's homework on how to parse JSON in JavaScript
  • 0
    @c64forthewin damn b, what kinda cs students y'all have over there where you're from? Most mkfrs I went to school were pretty legit.
Your Job Suck?
Get a Better Job
Add Comment