Oracle interview question

it was a coding question using javascript