Script Scraper

Pull Data from the Internet into Excel Spreadsheets.

HashTables

These structures store information against a key and the information can be retreived again using the key. The curly braces are used to create a hashtable.

Below a hashtable is used to store some names of USA states, the key is the abbreviation for the state.

var states = {};
states['NY'] = 'New York';
states['TX'] = 'Texas';
states['CA'] = 'California';
states['IL'] = 'Illinois';
Later in the program we can retrieve the full name of the state from the hashtable by providing the state abbreviation.
var mystate = state['CA'];
The variable mystate is initialized by looking up the state hashtable with the key 'CA' which returns 'California'.

There is also a shorter way to create a hashtable for literal data.

var states = ({'NY': 'New York', 
               'TX': 'Texas', 
               'CA': 'California', 
               'IL': 'Illinois'});