Python to JavaScript translation.