Why does JavaScript reserve Java keywords?

As you know, JavaScript contains all the Java keywords. Does anyone know why? JavaScript does not recommend using these Java keywords, but they work fine when used as identifiers.

+5
source share
4 answers

The story is that when they developed JavaScript (originally called Oak, I believe (apparently I confused the languages ​​with the previous statement that the original name was wrong.)), Netscape in partnership with Sun developed it. To seduce the Java community, they wanted to make JavaScript like Java, to make Java developers feel more comfortable with it, which is why they are so similar.

, , , , . , . , JavaScript, , script, , ( , , ). , , JavaScript, , , ?

+4

, Java, Javascript Java, .

, . ECMAScript:

" ..."

+4

, , .

, , Java JavaScript public.

, .

+3

Allegedly, JavaScript developers have suggested that these words can be used for additional functionality in a future version of JavaScript. To prevent backward compatibility issues, these words were previously marked as reserved.

+3
source

All Articles