K
K
Kamal Khafizov2018-11-16 02:26:55
JavaScript
Kamal Khafizov, 2018-11-16 02:26:55

Node.js includes all JS, in the sense that any stuff that can be found in the JS documentation can be used in Node.js code?

Given that Node.js is the back end.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Taratin, 2018-11-16
@Taraflex

No.
Only
https://developer.mozilla.org/en-US/docs/Web/JavaS...
+
https://nodejs.org/dist/latest/docs/api/
But there are polyfills for some browser APIs - look individually under the project.

C
Clark Kent, 2018-11-16
@FlashManiac

Think of it like this:
There 's javascript - it's a tool language - it's the same for nodejs , browsers , and can be used in other environments as well. It's just a language that you use to interact with the environment-provided interfaces ( APIs ). Along with the language come the basic types ( Number, String, Boolean, null, undefined, Date ).
There is an API , which is a certain set of classes, modules and methods that are provided by a specific environment. Nodejs has its own set of modules, and browsers have their own set of classes, methods, and global objects. It turns out that you can write some code that will work onnodejs and in browsers if the code does not affect the . For example, if you are writing a game, then you can abstract the game logic from the API and write it once - and it will work on both backend and frontend . This way it will be possible to run a simulation of the player's game on the backend . Or you have an application where some data structures are transferred to the server and you can write only once classes that work with them (parsing, etc.) and use them right away and there and there.

A
Abcdefgk, 2018-11-16
@Abcdefgk

No, not all. The alert () method cannot be applied, no matter how I tried.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question