Get With It!
-
Use with as a shortcut. In the with block, any methods or properties
you use without reference to an object are assumed to be specified in the
with object.
-
Saves typing, but slows execution.
with (Math){
var numberone = random();
var numbertwo = random();
var numberthree = random();
}
...as opposed to...
var numberone = Math.random();
var numbertwo = Math.random();
var numberthree = Math.random();
See previous example
Lab: Using the Date object with if
Home
Internet II: Day 3