more practice in js functions