This is a particularly easy way to play around with JavaScript,
and I recommend that you use it as you read this book.
用这种方式来调试JavaScript既简单又实用,这里强烈推荐读者使用这种方式来辅助你阅读本书。引自 ued@taobao翻译的第1章.
折腾JavaScript时, 这是一个很好的方式, 我强烈建议读者可以边看书, 边使用它们.
A similar but more
intrusive way to display output or debugging messages is by passing a string of text to
the alert() function, which displays it in a modal dialog box.
同样,也可以通过给alert()函数传入一段文本来弹出一个对话框,但这种输出调试信息的方法更具侵入性。引自 ued@taobao翻译的第1章.
// Arrays and objects can hold other arrays and objects:
var points = [ // An array with 2 elements.
{x:0, y:0}, // Each element is an object.
{x:1, y:1}
];