val a: Array[Int] = Array(1,2,4,5) val b: Array[Int] = Array(1,2,4,5) a==b // false
Is there a pattern-matching way to see if two arrays (or sequences) are equivalent?
a.corresponds(b){_ == _}
Scaladoc: true if both sequences have the same length and p(x, y) is true for all corresponding elements x of this wrapped array and y of that, otherwise false
true
p(x, y)
x
this
y
that
false