|
|
|
|
|
by boxed
760 days ago
|
|
Go, and F# do almost all positional arguments. I think Rust too. Java, C#, C, PHP are also positional only or 99% of the time. I assume Dart too. 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}.