hasKey
Class
Method of Hash
Library
hash.js
Syntax
exampleHash.hasKey(key);
Parameters
key A string indicating the key to look for in the associative array.
Description
Returns Boolean true if the key exists in the Hash, false if it does not.
Examples
var badSciFi = new Hash();
var actorExists = false;
badSciFi.setItem("Connery", "Zardoz");
badSciFi.setItem("York", "Logan's Run");
badSciFi.setItem("Douglas", "Saturn 3");
actorExists = badSciFi.hasKey('York'); // actorExists is true
actorExists = badSciFi.hasKey('Pertwee'); // actorExists is false