Visitar URL original
JavaScript - Simple English Wikipedia, the free encyclopedia
The Wayback Machine - https://web.archive.org/web/20260317193213/https://simple.wikipedia.org/wiki/JavaScript
Jump to content

JavaScript

From Simple English Wikipedia, the free encyclopedia
JavaScript
Designed byBrendan Eich
DeveloperNetscape
First appeared4 December 1995
Implementation languageScripting and programming language
Filename extensions.js (Standard JavaScript)

.mjs .cjs .jsx .tsx .ts .es6

.json (JavaScript Object Notation)
Websitewww.ecma-international.org/publications-and-standards/standards/ecma-262/

JavaScript is a high-level programming language that follows the ECMAScript standard. It was originally designed as a scripting language for websites but became widely adopted as a general-purpose programming language, and is currently the most popular programming language in use.[1] JavaScript is usually found running in a web browser as interactive or automated content, ranging from popup messages and live clocks to large web applications. JavaScript is also commonly used in server-side programming through platforms like Node.js,[2] or "embedded" in non-JavaScript applications where the base programming language lacks the high-level functionality that JavaScript offers.

Despite the similarities in name and syntax, JavaScript is not related to the programming language Java. Though the names of both languages are trademarks of Oracle Corporation, the two languages follow different design principles, and are actively developed by unrelated organizations.

Object Model

<!DOCTYPE html>
<head>
    <title>Example page</title>
    <script> // This is the script tag

    for (let counter = 1; counter <= 10; counter++) {
        document.body.innerHTML = document.body.innerHTML + counter + "<br>";
        
        /*
            This puts the number, then a new line element (<br>),
            at the end of the web page.
        */
        
    }

    // End javascript:
    </script>
</head>
<body></body>

The for() loop makes whatever code is between the { and the } happen more than one time. In this case, it keeps looping until numOfTimesAround is equal to 10, then it stops. This means it equals ten. It's a bit confusing at first, but it works.

Differences between Java and Javascript

[change | change source]
  • In Java, to define a variable, you have to say what type of variable it is: a number, a word, a letter, or more. In JavaScript, this is not necessary.
  • In JavaScript, functions are stored as variables (unlike Java). This makes the following code okay in JavaScript:
function sayHi() {
    alert("Hi!");
}

sayBye = function() {
    alert("Bye!");
}

sayHi();
sayBye();
  • JavaScript is interpreted, but Java, in most cases, must be compiled. This means that JavaScript needs to be run by another computer program (an interpreter), but finished Java can be run as its own program.
[change | change source]

References

[change | change source]
  1. ↑ "Stack Overflow Developer Survey 2021". Stack Overflow. 2021-08-01. Archived from the original on 2022-04-13. Retrieved 2022-04-18.
  2. ↑ "Server-Side Javascript: Back With a Vengeance". ReadWrite. 2009-12-17. Retrieved 2020-03-11.
  3. ↑ "Introduction to game development for the Web - Game development | MDN". developer.mozilla.org. 2023-04-14. Retrieved 2023-06-04.
  4. ↑ Eseme, Solomon (2022-11-21). "Top 6 JavaScript and HTML5 game engines". LogRocket Blog. Retrieved 2023-06-04.
  5. ↑ "var". MDN Web Docs. Retrieved 2018-03-24.
  6. ↑ "const". MDN Web Docs. Retrieved 2018-03-24.
  7. ↑ "let". MDN Web Docs. Retrieved 2018-03-24.
  8. ↑ "Javascript Tutorial - Comments".

Other websites

[change | change source]