creating ch4.js file to work with chapter 5 examples
creating a function that pop out the last element from an array