BCHM 4400 Lecture Notes - Lecture 3: Hash Table, Foreach Loop, Comma-Separated Values
Document Summary
Array: variable that contains list of data elements. Array assignment: array can be assigned list of comma separated values. Range operator ( ): used to create list of values w/o writing all the numbers out. Pop(): take last element off an array and returns the value. The function removes the last number from the value array and returns it to the scalar variable, fred. Push(): reverses the pop() function and adds new elements to the end of an array. Shift(): takes first element off of an array and returns the value. Unshift(): reverses the shift function and adds new elements to the beginning of an array. Sort() function: takes a list of values and sorts them in the internal character order. Hash table: data structure that can look up values by names. Unlike arrays, hash tables can combine different values. Hash element = scalar and surrounded by {}