This method adds a new item to the Dictionary associating it with the key name being passed.
Keys are meant to be strings but will be coerced as necessary during the addition. However, you cannot use an Array object to build the key name. If you do need to build a key name from an array, you must convert it to a string first.
The items being associated with Dictionary keys can be of any type.
You cannot replace an item with this method as a run time error is caused by an attempt to add a new object where the key name has already been used.
Prev | Home | Next |
Dictionary object | Up | Dictionary.Count |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |