Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
Chrome 86
Windows
Desktop
4 years ago
Test name Executions per second
plain 2380109.2 Ops/sec
try catch 2216194.8 Ops/sec
Script Preparation code:
AخA
 
var a = 0
function f () {
  a += 0.01
  if (a < 0) {
    throw new Error()
  }
}
Tests:
  • plain

     
    f()
  • try catch

     
    try {
      f()
    } catch (e) {
      console.log(e)
    }