+ 5
Can I use 'try' tag in javascript? If yes how?
Can I use 'try' tag in javascript? If yes how?
5 Answers
+ 3
try{
//some code
}
catch(error){
//handle error here
}
+ 5
You could handle exceptions in javascript like this:
window.onload = function() {
  try {
    throw "An exception";
  } catch(exception) {
    console.log(exception);
  }
}
+ 4
That piece of code is javascript. ECMAscript is the standard specification of js
+ 3
Javier Felipe Toribio thanks but its ECMAscript6
+ 2
but in sololearn the code debugger don't suported the EcMAscript6.