What is the ASP Dictionary object?

The ASP Dictionary object stores information as key-value pairs. The keys identify the objects in the dictionary. The dictionary object is similar to arrays, but comes with more functionality.

Methods

  • Items: This returns all the items which are present in the dictionary object.

  • Add: This adds any new key-value pair to the dictionary object.

  • Keys: This returns all the keys which are present in the dictionary object.

  • Exists: This returns true if a specified key exists in the dictionary object. Otherwise, it returns false.

  • Remove: This removes the specified key-value pair from the dictionary object.

  • RemoveAll: This removes all key-value mappings from the dictionary object.

Properties

  • Key: This updates an existing key-value pair with a new value in the dictionary object.

  • Item: This sets the value of an item in a dictionary object.

  • Count: This returns the total number of key-value mappings in a dictionary object.

  • CompareMode: This returns the comparison mode for comparing keys in the dictionary object.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved