javascript trigger error code example Example: jsjs trigger window error window.setTimeout(function() {throw new Error()}, 0);