Javascript practice

added comments. done with assignment