I'm kind of new to programming and i have a question that's been bothering me for awhile.Why is the JavaScript-language different in different programs/sites.I've used Codecademy to practice and i've noticed it's different from Eclipse and Unity.For example, in codecademy, you use: var blabla = something to declare a variable.In eclipse though, you use: int x = 2, String x = hey.Why is it like this? Thanks in advance.
Why is the JavaScript-language different in different programs/sites?
java;programming languages;javascript;coding style
Java and JavaScript are two different languages, see this answer on Stack Overflow:https://stackoverflow.com/a/245068/111143My guess is that Code Academy uses JavaScript, and Eclipse uses Java internally. Though the name sounds similar, they are not the same.JavaScript is an ECMAScript dialect, and there are several dialects of this, that are often used in client side software for scripting. Often code that looks a lot similar to JavaScript, is a different ECMAScript dialect, like JScript, og ActionScript.Java on the other hand is not an ECMAScript dialect, it is a wholly different programming language, JavaScript is named after Java since it was planned as a complementary scripting language for Java, after Netscape and Sun made a license agreement, it was originally called Mocha: https://stackoverflow.com/a/2018747/111143