let a = "foo"; let b = "bar"; console.log(a, b); [b, a] = [a, b]; console.log(a, b);
Output
foo bar bar foo
package main import "fmt" func main() { a := "foo" b := "bar" fmt.Println(a, b) b, a = a, b fmt.Println(a, b) }
← rest operator classes→