HelloWorld.js
function get_value(){ try{ return 10; }catch(e){ return 20; }finally{ return 30; } } console.log(get_value());
What is the output of
above program?
If
a finally block returns a value, then the value returned by finally block is
the return value for entire try-catch-finally block.
In
the above example, 30 is printed to console.
No comments:
Post a Comment