In python we can omit a parameter with its default value in a function call. e.g.
def post(url, params={}, body={}):
print()
print(url)
print(params)
print(body)
post("http://localhost/users")
post("http://localhost/users", {"firstname": "John", "lastname": "Doe"}) # Skipped last argument (possible in JS as well)
post("http://localhost/users", params={"firstname": "John", "lastname": "Doe"}) # same as above
post("http://localhost", body={"email": "user@email.com", "password": "secret"}) # Skipped 2nd argument by passing last one with name (i.e. "body")
Can I achieve this in JS? Like omitting the 2nd argument and just pass the last one. (As in the last case). Other cases are possible in JS but I can't find a way to achieve the last one