javascript function propotion practise