Dictionary.Remove()
JScript3.0+Syntax
dictionaryobj.Remove(key)
Description
The Remove() method of the Dictionary object removes the key, item pair from the dictionary that matches the key passed into the method. If no match is found, an error is returned. Nothing is returned from this method.
Example
Listing 9.23 uses the Remove() method to remove berry from the dictionary.
Listing 9.23 Remove berry Item and Associated Key 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 berry from dictionary fruits.Remove("B"); ... |
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.