by boxed · 2y ago · 0 comments
We are talking named/keyword/etc.
Personally I find positional arguments to be an anti-pattern in all but a very specific set of circumstances.
In JS, when creating an object, instead of writing {name: name}, where "name" is both the key in the map as well as the variable you want it to assign to, you can do {name}, whereas e.g. in Go you would do map[string]any{"name": name}.
Edit: Or, for completeness' sake, it's the same with structs in Go, where you would instantiate a struct like this: Person{name: name}.