Javascript function joining.