Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.
This repository was archived by the owner on May 31, 2024. It is now read-only.

Named method arguments #12

@theodorton

Description

@theodorton

Assume the following code:

def fn(arg_a, arg_b, arg_c)
  ...
end

fn(1, 2, 3)
fn(1, 2, arg_a: 3)
fn(arg_a: 1, arg_b: 2, arg_c: 3)
fn(arg_c: 1, arg_b: 2, arg_a: 3)

JavaScript has no concept of named arguments. An object argument would of course be possible, but that would leave out the first and second variant. I don't want to litter the function definitions with too much new code, but I'm not sure there are any other options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions