Test task in javascript