Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8581141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:58:38+00:00 2026-06-11T20:58:38+00:00

It seems like with other languages that support Try/Catch, developers make use of that

  • 0

It seems like with other languages that support Try/Catch, developers make use of that feature more than they do in JavaScript. Is there a reason for this? Is the JS implementation of Try/Catch flawed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:58:40+00:00Added an answer on June 11, 2026 at 8:58 pm

    Try taking a look at this article: http://dev.opera.com/articles/view/efficient-javascript/?page=2#trycatch

    From the above link:

    The try-catch-finally construct is fairly unique. Unlike other constructs, it creates a new variable in the current scope at runtime. This happens each time the catch clause is executed, where the caught exception object is assigned to a variable. This variable does not exist inside other parts of the script even inside the same scope. It is created at the start of the catch clause, then destroyed at the end of it.

    Because this variable is created and destroyed at runtime, and represents a special case in the language, some browsers do not handle it very efficiently, and placing a catch handler inside a performance critical loop may cause performance problems when exceptions are caught.

    You can also view a similar question here

    UPDATE

    Adding a link to: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers as it contains useful information regarding V8 and how it handles these (and similar) constructs.

    In particular:

    Currently not optimizable:

    • Generator functions
    • Functions that contain a for-of statement
    • Functions that contain a try-catch statement
    • Functions that contain a try-finally statement
    • Functions that contain a compound let assignment
    • Functions that contain a compound const assignment
    • Functions that contain object literals that contain proto, or get
      or set declarations.

    Likely never optimizable:

    • Functions that contain a debugger statement
    • Functions that call literally eval()
    • Functions that contain a with statement
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create one list based on two other lists. But seems like
Seems like there should be... Right now it just seems like magic that you
I'm looking for a IDE that supports PHP/JAVA/CSS/HTML/JAVASCRIPT and possibly other languages. Jetbrains IntelliJ
I have an application that needs to support a multilingual interface, five languages to
From my understanding of C it seems that you are supposed to use malloc(size)
Long-term C++ programmer (that's me) exploring other languages and is wondering whether it is
In Javascript, it seems like using property accessors is not all that common (unlike
I know this seems like a repeat question, but i've read all the others
Seems like i need some help with a project. I have a routine ,
Seems like cuke doesn't show the full error message (at least when problem occurs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.