Resource allocation limitations

JavaScript programs can allocate four types of values as they run: objects, properties, strings, and floating-point numbers.

For example, the following script allocates an object and two properties:

var myobj = new Object;
myobj.color = "red"; 
myobj.size = "large";

The following script allocates a string:

var mystr = "cruella" + "deville";

This script allocates a floating-point number:

var x = 3.14159 - 2.71828;

JavaScript automatically garbage collects values that are no longer in use.


Allocating objects
Number of objects in use