方法抛出异常

异常处理

//任何函数都可能抛出错误
function functionWithException() {
    throw new Error("test exception");
}

functionWithException(); //<- Error