Learning JS, why is typeof not camelcased?

It said earlier in the document that everything should be camelCased, and then it gets to this and it’s not camelCased. I’m just confused.

Every variable that we write in js should be camelCased, but typeof is already an existing operator in js. Why the fluke? Maybe someone has a more precise answer but it could be from the days when js was trying to ride off of Java’s coattails (Java has typeof, instanceof). There was a time when Oracle’s Java was “hot” in the 90s thanks to a lot of marketing investment so when (Netscape?) created javascript they deliberately picked a name that was similar (other companies do this still, every now and then).

Is this a clear case of the copying?? I don’t know.

Hypothetically, if they wanted to make this uniform, since so much of the web depends on js they can’t exactly deprecate a lot of things so once it’s part of the language it’s very hard to remove it without a large coordinated effort. And if it ain’t broke…

Part of the quirks of js…?

Anyways, all that a bit of speculation.

2 Likes

Thank you for the quick reply and makes sense.