Nice article! While writing TS is really important to keep in mind how JS works behind the scenes like for example the private properties you mentioned.
Another edge case to have in mind is when checking instanceof with variables. Consider the following example where we check dynamically that a variable is an instance of a dynamically provided class name (both myInstance and myClass are variables)
if (myInstace instanceof myClass)
The above will be always false when transpilling to JS because the typescript class name is lost.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article! While writing TS is really important to keep in mind how JS works behind the scenes like for example the private properties you mentioned.
Another edge case to have in mind is when checking
instanceof
with variables. Consider the following example where we check dynamically that a variable is an instance of a dynamically provided class name (bothmyInstance
andmyClass
are variables)if (myInstace instanceof myClass)
The above will be always false when transpilling to JS because the typescript class name is lost.