dazzledbeans to Programmer [email protected] • 2 years agoWith PieMixinlemmy.worldimagemessage-square20fedilinkarrow-up1343
arrow-up1343imageWith PieMixinlemmy.worlddazzledbeans to Programmer [email protected] • 2 years agomessage-square20fedilink
minus-square@[email protected]linkfedilink8•2 years agoIt looks exactly like c++ and c# and java and probably others.
minus-square@[email protected]linkfedilink6•2 years agoJava only has instanceof and getClass, not typeof.
minus-square@[email protected]linkfedilink1•2 years agoProbably because Java and C# take much inspiration from C++. They aren’t called “C-based” languages for nothing 😉
minus-square@[email protected]linkfedilink1•2 years agoTypescript! Though it’s less useful, since the Typescript types aren’t available at runtime, so you’ll just get object for non-primitive values.
It looks exactly like c++ and c# and java and probably others.
But neither c++ or Java have typeof
Java only has
instanceof
andgetClass
, not typeof.Probably because Java and C# take much inspiration from C++. They aren’t called “C-based” languages for nothing 😉
Typescript! Though it’s less useful, since the Typescript types aren’t available at runtime, so you’ll just get
object
for non-primitive values.