with statements establish default objects for sets of statements. JavaScript reviews unqualified names to determine whether the names are properties of the default object. If an unqualified name matches a property, the property is used in the statement; otherwise, a local or global variable is used.
Example—Math is specified as the default object; the PI property and the cos and sin methods are referenced, but no object is specified for the references; therefore, Math is assumed to be the object of the references: