Some basic exercises in javascript