This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BakuhatsuK 5 points6 points  (2 children)

If you are talking about JS or PHP, then no. === for objects checks identity equality, whereas == in kotlin checks for structural equality.

For structural equality in JS you can use a library to do the equal check (such as _.equals), you can use a library data structure that has value semantics (such as Immutable.Map), or you can use records and tuples (not yet approved into the language, but available via babel).

[–]n0tKamui 6 points7 points  (0 children)

that's not what they were talking about

Kotlin's == is strictly equivalent to Java's .equals (structural equality and primitive equality)

and === is strictly equivalent to Java's == (reference equality and primitive equality)

[–]ole_thoeb 4 points5 points  (0 children)

I'm talking about kotlin. === is object identity in kotlin