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
Post a Comment