Arrays
Arrays can also be created using a key/value pair combination. These are often referred to as associative arrays or hashes. In a hash each value is associated with a unique key. Unlike list arrays that use a number as an index value, associative arrays use any value. The easiest way to comprehend how a hash works is to think of it as a table. In the following table the state name serves to role as key and the city is the value.
| State (key) | City (value) |
| | |
| NSW | |
| | |
| | |
| | |

This workshop shows a perfect practical guidance about array program. Well Done Kunal!
ReplyDelete