Is `java` a reserved keyword in JavaScript?

I noticed that several JavaScript IDEs (e.g. Sublime) show a javasyntax highlighted word as a reserved keyword.

Older versions of Firefox have problems with the java function.

function java() {
    alert("This function can not be called");
}

Is this really a keyword? If so, what is it for?

+4
source share
3 answers

Ultimately, the answer is not a reserved keyword ; you should be safe when using javaa variable as the name.

http://www.javascripter.net/faq/reserved.htm, , java , . , , , Java Applet.

, . , Firefox 16 Mozilla Globals Packages, java netscape (. 2.1.5 : , java netscape )

, , Mozilla LiveConnect Documentation, Java Firefox

. Java- Gecko 16.0,

:

var aJavaList = new java.util.LinkedList();

, Mozilla java (, , ?), .

+4

, Java, Javascript Java, .

, . ECMAScript:

The following words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions...

http://www.javascripter.net/faq/reserved.htm

+4

According to this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Reserved_Words

No, this is not a reserved word.

Taking and running your function in the browser console confirms this.

+2
source

Source: https://habr.com/ru/post/1535368/


All Articles