finished chapter 2 exercises

first round of exercises from eloquent js book