pop
Class
Method of Hash
Library
hash.js
Syntax
exampleHash.pop();
Description
Returns the value of the item in the last position of the Hash, and removes that element.
Examples
var badSciFi = new Hash();
var movie = '';
var moviesLeft = 0;
badSciFi.setItem("Connery", "Zardoz");
badSciFi.setItem("York", "Logan's Run");
badSciFi.setItem("Douglas", "Saturn 3");
movie = badSciFi.pop(); // movie is "Saturn 3"
moviesLeft = badSciFi.length; // moviesLeft is 2
movie = badSciFi.pop(); // movie is "Logan's Run"
moviesLeft = badSciFi.length; // moviesLeft is 1
movie = badSciFi.pop(); // movie is "Zardoz"
moviesLeft = badSciFi.length; // moviesLeft is 0