javascript - What is the difference between throw Error and console.error -


what difference between these 2 statements, , there reason use 1 on other?

throw error("msg"); console.error("msg"); 

in limited experience, i've seen throw error() used. there particular reason why?

also, there equivalent console.warn() in same fashion?

throw ... raises exception in current code block , causes exit, or flow next catch statement if raised in try block.

console.error prints out red message browser developer tools javascript console , not cause changes of execution flow.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -