Training javascript for fun