Implementing JavaScript functions.