Nowadays it is possible, Javascript although it is a front-end language, it allows to build backend applications, there are some frameworks that make use of it as backend as Node.js. It is also known as Ecmascript, and has evolved a lot in recent years, from version 6 to version 7 and so on...
Microsoft created Javascript in 96 and Netscape improved, normalizing the language, adopting Ecmascript metrics, was born to render HTML content, basically the rendering structure of a page is based on Javascript through the manipulation of GIFT.
The browsers are HTML renderers, everything that is done today in relation to HTML, go through this process of construction and/or reconstruction, the events, the elements, everything is that will be presented as HTML element structure, is through the DOM, among many other things that are read, and interpreted, before magic takes place, synchronous or asynchronous rules are defined, depending on the hierarchy established in their events and functions.
Each browser has a rendering engine, most today recognize javascript and allow it to be used, if the user does not disable it manually, from there you have access to the native functions, and can see this through the console of your browser, just write window
and enter and you’ll have the console.log of the first layer of your native functions.
Inside a javascript code, you can put the console.log(object) native method to see on your console printing outputs of the worked elements, which can be diverse, such as objects, strings, numbers, booleans etc.
But to get the most out of it, if you don’t want to be familiar with Node.js or find it too complicated, you can opt for using any other backend language (server side) that supports building model data structures JSON, which is basically a data structure similar to XML, whose data is consumed by javascript methods. Although you don’t need to use backend structures, you can only consume a file of the type: /path/arquivo.json
, as if accessing a database, only it is only a data presentation file.
Still for APP applications like mobile, you have React-Native, which uses Javascript to chat with native architectures in a hybrid way (both Android and ios). You may want to find out about Flutter that today is the newest and is competing with the React-Native, was developed by Google and uses its own Dart language.
For desktop, you can use very similar javascript structure models, using only React.
Other examples of Javascript-facing frameworks / libs:
- Angular 2, 4, 5, 6, 7, 8 +
- Angularjs
- React
- jQuery (library)
Yes, it is possible. Node.js is for this, but there are also other javascript implementations that can be used, I suggest you ask a more specific question in this case. As for the rest of your question, I think it is not far from here: https://pt.meta.stackoverflow.com/a/5487/132
– Victor Stafusa
@Victorstafusa if the reason to close is this example linked, then I definitely disagree with the closing. But the question really isn’t very good.
– Maniero
If you’re thinking about Javascript only as language, yes it is possible, because as it was mentioned by @Victorstafusa, Node.js uses language Javascript and runs on the server, but quite different with regard to functionality (the client and server side objects are completely different, only the language is the same)
– Ricardo Pontual
You may have heard this saying, but here it goes: "when all I have in my hand is a hammer, anything seems to be a nail". Why limit yourself to a single tool, if there is a varied range, for each type of problem?
– Marcelo Shiniti Uchimura
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points you will have as soon as you accept the answer).
– Maniero