In Javascript, what does the reserved keyword "short" do?

Viewed 128

I'm merely trying to find the definition and usage of the key word, short, in JavaScript. I do not care about backwards compatibility and the likes, as to say that I don't want responses as to if, how, and why it may be an up to date syntax. I just want the definition. A Simple example would be best. Thank you.

2 Answers

They belong to the so-called future keywords by the ECMAScript specification.

They have no special functionality at present, but they might at some future time, so they cannot be used as identifiers.

short as a reserved word was part of an old ECMAScript specification:

The following are reserved as future keywords by older ECMAScript specifications (ECMAScript 1 till 3)
[...] short [...]

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords

In ECMAScript 5/6 short was removed from the list of reserved words. Nonetheless for compatibility with older browsers not implementing either, you shouldn't use it anyway.

My guess they were planning on using it for what its for in Java "Storing a whole number between -32768 to 32767." but then decided there was no need to have that integer type so they removed it in ECMAScript 5/6 standard.w3schools

Related