Javascript Arrays

(Assignments here & here)

Tutorials 

Problem Set

Blog Questions

  • Array method pop( ) removes the last value in the array and returns the value that was removed. Array method push( ) inserts a value into the last spot in the array and returns the total number of values in the array. Array method shift( ) removes the first value in the array and returns the value that was removed. Array method unshift( ) inserts a value into the first spot in the array and returns the total number of values in the array.
var array = [ "a", "b" , "c"]
undefined
array.push("d")
4
array.pop()
"d"
array.shift()
"a"
array.unshift("a")
3
array
(3) ["a", "b", "c"]
  • I believe BleacherReport uses an array of data to store the different articles that are presented on the page.

Leave a Reply

Your email address will not be published. Required fields are marked *