Specifications
Example:
var i = 10;
while ( i > 0 ) {
debug( i );
i--;
}
See also continue and break.
with
with ( QualifyingName ) {
Statements;
}
This keyword is used to indicate that any unqualified names in the Statements should be qualified
by QualifyingName.
Example:
// Without with
debug( Math.abs( -4 ) );
debug( Math.pow( 2, 3 ) );
debug( Math.random() );
// With with
with ( Math ) {
debug( abs( -4 ) );
debug( pow( 2, 3 ) );
debug( random() );
}
If multiple qualifying names are required, with statements can be nested.
Forcing the interpreter to do the lookup may be slower than using the fully qualified names.
18.3 Utility module
Text encoding
JavaScript strings represent Unicode characters (internally encoded in UTF-16). Care must be taken
when converting a Unicode string to or from a sequence of 8-bite bytes, such as a file on disk
(File class) or a byte array in memory (ByteArray class).
The Codecs supported by scripting API can be classified as follows:
Data typesDescriptionCodecs
String <- -> ByteArray / FileMap Unicode code points to 16-bit
(two byte) representation
UTF-16, UTF-16BE,
UTF-16LE
String <- -> ByteArray / FileMap Unicode code points to 8-bit
(single byte) representation
UTF-8, latin1, Apple
Roman, …
String or ByteArray may be used
on both sides
Map an 8-bit byte stream into a 7-bit
ASCII representation
Hex, Base64
408
Enfocus Switch 10