|
February 15, 2000 Creating Objects Tips: February 2000
Yehuda Shiran, Ph.D.
|
|
One of the first topics you need
to learn when learning a new language is how to allocate memory for your data
structures. In JavaScript, the operator new
is the memory allocator which you would use in conjunction with creating new objects.
All intrinsic JavaScript objects begin with a capital letter. For example, in
order to create a new array of length 9, you would write the following:
Here's an example of how to create a constructor function:
where Notice the usage of the
Learn more about memory allocation in Column 18, JavaScript Animation, Part I.
People who read this tip also read these tips:
Look for similar tips by subject:
|