1.js 错误

var objClass = {
    foo:1,
    bar:2
};

function printf() {
    var aaa:objClass;
    aaa.foo = 2;
    console.log(objClass.bar);
}
function throwIt() {
    throw new Error("");
}

function catchIt() {
    console.log(catchIt.name);
    try {
        throwIt();
    }catch (e) {
        console.log(e.stack);
    }
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DataType</title>
    <script type="text/javascript" src="scripts/dataType.js"></script>
</head>
<body>
<p onclick="catchIt();return false;">Test</p>
</body>
</html>
View Code

相关文章: