43

I think this might be too much to handle for a js newbie 😉

Comments
  • 9
    What bothers me the most about this code is that a single account is an array and not an object. Why?
  • 6
    Correct me if I’m wrong but doesn’t the loop iterating accounts return false immediately at the first incorrect name?
  • 2
    @growling yep. The loop doesn't work. So the kid asked on stackoverflow. And of course, got downvoted immediately. I give him an answer before it's closed.
  • 0
    @RobertSmits idk. I just answered a stackoverflow question.
    But we do have similar system. It's fairly common to have a user has multiple roles, each role has multiple rights
  • 3
    @sunfishcc That’s good you helped him. A good encouragement instead of blasting downvotes. The kid’s gotta start somewhere!
  • 4
    Oof.
    Looks like code I wrote when I was 13.
  • 0
    @Root or mind controlled by C#.
    I was making pizzas when I was 16. Some simple logic used to scare the shit out of me 🤦‍♂️
  • 1
    Got to invert those ifs and return early.
Add Comment