4 ms·
Same with Golang: A := []int{1,2} B := append(A, A...) fmt.Println(B) > [1, 2, 1, 2]
by the_clarence 8y ago
Same with Golang:
A := []int{1,2}
B := append(A, A...)
fmt.Println(B)
> [1, 2, 1, 2]
- ereyes01 8y agoGolang has no equivalent to double-* since it doesn't do keyword arguments.
- masklinn 8y agoNeither does javascript, "keyword expansion" only occurs for object literals (which is why it's unambiguous: objects can't be created from sequences and don't implement the iteration protocol, so expansion within an object context can easily be special-cased).