Equality operator for lists

Hi Chris,

In MWorks, how does the equality operator work for lists, does it do deep comparison?
For example, are all of the following reports correct below?

Mark


var ab = [1,2,3]
if (ab == [1,2,3] {
report(‘hopefully true’)
}

var ab = [‘a’, ‘b’, ‘c’]
if (ab == [‘a’,‘b’,‘c’] {
report(‘hopefully true’)
}

if (ab == [1,2,3] {
report(‘hopefully false’)
}
if (ab == ‘astring’ {
report(‘hopefully false’)
}

Hi Mark,

Yes, equality comparison is always deep, for both lists and dictionaries. All of your examples work as you expect.

Cheers,
Chris