Is it possible to use multiple catch in J S(ES5 or ES6) as described below (this is just an example):
try { // just an error throw 1; } catch(e if e instanceof ReferenceError) { // here i would like to manage errors which is 'undefined' type } catch(e if typeof e === "string") { // here i can manage all string exeptions } // and so on and so on catch(e) { // and finally here i can manage another exeptions } finally { // and a simple finally block }
This is the same as in C# or in Java .
Thanks in advance!
user5548116
source share