Create javascript functions with optional, default and named paramaters.