Figured out some basic javascript, how to do cases in javascript and also array 'iteration'