dazzledbeans to Programmer [email protected] • 1 year agoWith PieMixinlemmy.worldimagemessage-square20fedilinkarrow-up1342
arrow-up1342imageWith PieMixinlemmy.worlddazzledbeans to Programmer [email protected] • 1 year agomessage-square20fedilink
minus-square@[email protected]linkfedilink8•1 year agoIt looks exactly like c++ and c# and java and probably others.
minus-square@[email protected]linkfedilink6•1 year agoJava only has instanceof and getClass, not typeof.
minus-square@[email protected]linkfedilink1•1 year agoProbably because Java and C# take much inspiration from C++. They aren’t called “C-based” languages for nothing 😉
minus-square@[email protected]linkfedilink1•1 year 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.