ar1=(1); ar2=(1); [ $ar1 = $ar2 ] && echo true || echo false
true
>>> [1] == [1]
True
fn main() {
println!("{}", [1] == [1]);
}
true
let ar1 = [1]
let ar2 = [1]
print(ar1 == ar2)
true
(This one's a little tricky because ==
isn't defined for slices. So maybe apples to oranges.)
Go
package main
import (
"fmt"
"reflect"
)
func main() {
ar1 := []int{1}
ar2 := []int{1}
fmt.Println(reflect.DeepEqual(ar1, ar2))
}
true
[1] == [1]
# => true