spread operator
Node.js
const array = [1, 2, 3, 4, 5]
console.log(...array)
Output
1 2 3 4 5
Go
package main
import "fmt"
func main() {
array := []byte{1, 2, 3, 4, 5}
var i []interface{}
for _, value := range array {
i = append(i, value)
}
fmt.Println(i...)
}
Output
1 2 3 4 5
当前内容版权归 miguelmota 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 miguelmota .