I have been learning about mutability in Python, Ruby and Javascript. My assumption was that Ruby and Python would behave similarly to Javascript when using the comparison operator between two arrays or two objects of the same value. Why are Python and Ruby returning true when comparing arrays of same values but Javascript does not?
For example:
Python:
>>> x = [1,2,3,4,5]
>>> y = [1,2,3,4,5]
>>> x == y
True
Ruby:
> x = [1,2,3]
> y = [1,2,3]
> x == y
=> true
Javascript:
> x = [1,2,3]
> y = [1,2,3]
> x === y
false