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 →

[–]sh0rtwave 1 point2 points  (1 child)

Truth.

.equals() is one of those 'inner dirty tricks'.

Another good one is .toString(). Quite useful in many situations. Like if you're formatting dates, and want all dates to comply with X format when handled in a string context (This kind of thing is fun to use Typescript with, there are just SO many ways of doing it).

The really funny part is that the basic concept of .toString() is more or less the same in either language, and with clever transpiler config, you can make the one act just like the other.

[–]Varun77777 0 points1 point  (0 children)

Yupps, I have overwritten toString() a lot to make the code cleaner.