Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
JavaScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Java === A common misconception is that JavaScript is directly related to [[Java (programming language)|Java]].<!-- While one is intentionally similar to the other, they're different. (Previously the misconception sentence said "JavaScript is similar to Java" but that's not a misconception) --> Both indeed have a C-like syntax (the C language being their most immediate common ancestor language). They are also typically [[Sandbox (computer security)|sandboxed]], and JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's {{code|lang=javascript|code=Math}} and {{code|lang=javascript|code=Date}} objects are based on classes from Java 1.0.<ref name="popularity">{{cite web | url=https://brendaneich.com/2008/04/popularity/ | title=Popularity | first=Brendan | last=Eich | author-link=Brendan Eich | date=April 3, 2008 | access-date=January 19, 2012 | archive-date=July 3, 2011 | archive-url=https://web.archive.org/web/20110703020955/https://brendaneich.com/2008/04/popularity/ | url-status=live }}</ref> Both languages first appeared in 1995, but Java was developed by [[James Gosling]] of Sun Microsystems and JavaScript by [[Brendan Eich]] of Netscape Communications. The differences between the two languages are more prominent than their similarities. Java has [[static typing]], while JavaScript's typing is [[Dynamic typing|dynamic]]. Java is loaded from [[Compiler|compiled]] bytecode, while JavaScript is loaded as human-readable source code. Java's objects are [[Class-based programming|class-based]], while JavaScript's are [[Prototype-based programming|prototype-based]]. Finally, Java did not support functional programming until Java 8, while JavaScript has done so from the beginning, being influenced by [[Scheme (programming language)|Scheme]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)