Tsallaka zuwa abun ciki
Justice Tech School

Identity and Equality

== compares values and === compares class instance identity.

Example
class A {}
let a = A(), b = a, c = A()
print(a === b, a === c)
print([1, 2] == [1, 2], "a" != "b")

Exercise

Same instance.

a  b

Quiz Test

What does === test?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.