you are viewing a single comment's thread
view the rest of the comments
[–] 58 points 11 months ago (4 children)
function myFunction() {
  try {
    x = new Random().nextInt();
    if (x != 10) {
     throw "not 10";
    }
    else {
      return (10)
    }
    catch(err) {
      myFunction()
    }
  }
}

x = myFunction()

Commit notes: Added error handling

  • source
  • hideshow 4 child comments