javascript 异常处理

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>异常语句</title>
</head>
<body>
<script>
try {
console.log(username)
} catch(err) {
console.log(err)
} finally {
//无论怎么都执行
}
</script>
</body>
</html>

posted @ 2018-08-09 14:57  python成长中  阅读(83)  评论(0编辑  收藏  举报