Dictionary.RemoveAll()
JScript3.0+Syntax
dictionaryobj.RemoveAll()
Description
The RemoveAll() method of the Dictionary object removes all key, item pairs from the dictionary. Nothing is returned from this method.
Example
Listing 9.24 uses RemoveAll() to remove items from the dictionary.
Listing 9.24 Remove All Items from the Dictionary
<script language="JScript"> <!-- Hide //Create dictionary var fruits = new ActiveXObject("Scripting.Dictionary"); //define elements of dictionary fruits.Add("A","apple"); fruits.Add("B","berry"); fruits.Add("G","grape"); fruits.Add("O","orange"); //Delete all items from the dictionary fruits.RemoveAll(); //Hide End --> </script> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.