代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
try{
var arr = ["java","script",true];
for(i;i < arr.length;i++){
console.log(i + "-" + arr[i]);
}
}catch(e){
console.log("Error:" +e);
console.log("Error Message:"+e.message);
console.log("Error Name:"+e.name);
console.log("Error number:"+e.number);//错误的代号,如果有的话
}
</script>
</body>
</html>