Las excepciones se manejan (Js)

  • Throw: Lanza un error y se para la ejecución.
  • Try: intenta ejecutar la función y, si tuviera algún error (throw)…
  • Catch: …lo captaría este catch y nos lo enseñaría.
  • nuestra función lanzaError()
  • un console.log

Ejemplo con un callback

throws(inferior());
throws(inferior);

Conclusión

--

--

If something does not work, ACT. Yes, you! That’s why I’m now #Developer at @vmware . Formerly @kairos_ds .Constantly absorbing knowledge. Proud #Adalaber

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aida

Aida

If something does not work, ACT. Yes, you! That’s why I’m now #Developer at @vmware . Formerly @kairos_ds .Constantly absorbing knowledge. Proud #Adalaber