en.javascript.info/1-js/01-getting-started/01-hello-javascript/article.md
Ilya Kantor db4a880974 WIP
2020-10-29 21:46:52 +03:00

33 lines
1.3 KiB
Markdown

# Hello, JavaScript!
The programs in JavaScript are called *scripts*. They can be embedded right into HTML using `<script>` tag and run automatically as the page loads.
For example, this HTML-page shows the "Hello" message:
```html run
<!doctype html>
<script>
alert("Hello!");
</script>
```
JavaScript can execute not only in a browser, but also on a server, or actually on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine).
Browsers have built-in JavaScript engines, so they can run scripts.
We can also run scripts using [Node.js](https://nodejs.org), it's commonly used to build server-side applications.
Depending on the environment, JavaScript may provide platform-specific functionality.
- In a web browser, JavaScript can manipulate the web-page, send network requests, show messages and so on.
- Node.js allows to run a web-server.
...And so on. Even a coffee machine may include its own JavaScript engine, that could allow us to program its recipes.
![](javascript-engine.svg)
In this tutorial we concentrate on the "core JavaScript", that's the same everywhere.**
After you learn it, you can go in any direction: learn browser functionality, how to write servers and so on.
Please turn the page to start learning JavaScript!