Type Casting in ActionScript

Notes:

Type Casting in ActionScript Programming Language:
Converting one type of data value to another type is called as type casting.

There are two types of type casting:
Implicit type casting (Coercion): Done by Action Script engine
Explicit type casting (Conversion): Done by programmers

Implicit type casting:
If required Action Script engine automatically converts one type of value to another type.
This is known as implicit type casting.

Ex:
trace(2+4.3);//2.0+4.3 = 6.3
trace("2"+2);//"2"+"2"= "22"
trace(2+"2");//"2"+"2"="22"
trace(2+2+"2");//"42"
trace("2"+2+2);//"222"
trace("2"+(2+2));//"24"

Explicit type casting:
If required, programmers can also convert one type of value to another type.
This is known as explicit type casting.

For explicit type casting, we use built in type casting functions or wrapper functions:
parseInt function
parseFloat function
wrapper functions