May leave the Catch issue blank for reasons in JavaScript

I am working on a large code base and am trying to reorganize a bunch of old javascript code. My boss noted that there are many blocks in the code try{ }catch(err){ }where the developer left an empty block catch.

In any case, is there any harm in leaving these blocks of code empty? I heard that this can cause problems in Java, but is there any harm in the case of JavaScript.

Example:

try {
      if (value != null) {
       var typeOne = report;
       returnVal = formatB;
     }
 } catch (err) {
    // Is this bad?
 }
+4
source share
1 answer

, , , Catch . - , , , . .

+1

Source: https://habr.com/ru/post/1655376/


All Articles