completed js functions tasks