22. 寫得少,做得多
Implemented in JavaScript 1.0with
with(document) {
write('<p>媽!我在這!</p>');
write('<p>我寫 10 行省了十次 document</p>');
}
var a = 0;
with(Math) {
/* 所有跟 Math 有關的都可以省略不打 */
/* 現在你知道 JavaScript 多討人厭了吧 */
a = PI * 5 * 5;
b = r * cos(PI);
c = r * sin(PI / 2);
}
36. LEARNING JAVASCRIPT
“
Crockford is inspirational and extraordinarily
rewarding to watch and listen to.
--Flubba
”Best resources to learn JavaScript