46
tomando
7y

The first stage of fatigue. I would've loved to know my reasoning behind why I put wrote this

Comments
  • 3
    Isn't phoneError() listed twice? And calling itself 😂
  • 1
    @itsdaniel0 and phoneMessage too. Also phoneOpen is just calling another function
  • 1
    @PaddiM8 Easier 😉
  • 3
    @PaddiM8 well hey, if I'm retarded enough to code that, why not go all the way?
    Also I couldn't be bothered opening it on my laptop, my phone was right there aaaand my actual code is probably just as embarrassing lol
  • 2
    Ram bomb. Nice 👌
  • 1
    @itsdaniel0 also,

    *~ https://devrantron.firebaseapp.com ~ dacexi whispered into your ear.*
  • 0
    @Dacexi ram bomb?
  • 1
    @tomando the function would call itself so many times without resolving it which would use up heap until the program crashes.
  • 2
    @Dacexi actually. This is js. So maybe it doesn't do that.
  • 2
    @Dacexi haha I get you now. That's pretty much what happened except it was running in chrome so it's sandboxed and crashed itself
  • 1
    You need to dance sir!
  • 2
    JavaScript will throw an error if it's a function calling itself till infinity. Also I think it'll error on first loop, because it doesn't pass the argument. I might be wrong on that
  • 1
    @matsaki95 it just crashed itself with a an error. Since it's sandboxed in Google Chrome (and probably all browsers?) the script can only be a certain size before its stopped. In this case the call stack got too large (every time a function is called, the caller is added to a call stack so it can be popped off again when the function returns) so it crashed the script. There's no need for a call stack 200 calls long in a browser because more than likely you've over complicated it by then
  • 1
    @ChainsawBaby nah js is pretty chill with arguments. If you don't supply an argument it'll just set it to undefined if the function references it. I'd need to check about passing in extra functions but I'm 99% sure it doesn't matter either. The engine won't pick up the error in the script until it's running it, because the call stack gets too large
Add Comment