Ad
  • Custom User Avatar

    Sometimes this happens no test are not bad! :)

  • Custom User Avatar

    I'm not sure if it's this kata specifically or whatever server runs the code, but it took several attempts to finally be able to submit my solution. It kept saying it took over 10 seconds to run. Looking at the other solutions (nearly identical to mine) I feel that either the test are bad or something is going on with the server.

  • Default User Avatar
  • Default User Avatar

    Why do you put a break statement if you are returning? returning will break you out of there anyways. (Just curious as to why you chose to do that).

  • Default User Avatar

    my point to it is states you must return null. While this is somewhat design choice, if infinity does not evaluate to null and someone else uses this JS for something else and only test if null then they'll have an error in their JS. It's not a big deal, but technically the code doesn't meet spec.

  • Default User Avatar

    I don't think these will work in all cases. They don't appear to account for dividing by zero. When I put these solutions in JsFiddle the divide by zero comes back as -Infinity.