- allows you to work with CSS and HTML (changing, adding, deleting information);
- provides interaction with users on the page (keystrokes, clicks, moving the mouse cursor);
- used to send requests to the server, download/upload files (AJAX JS technology);
- works with cookies.
- active in an open tab, no access to other open tabs;
- if JS didn’t open a browser window, it won’t be able to close it;
- there is no way to hide the source code of the page;
- no access to system functions of the OS.
It is connected in two ways: through the code on the page and through an external file. In the first case, you should specify <script>//Program body</script>. The code from the external file is included with the command <script src=”name.js”></script>
- Essential for web development. Scripts are supported by all popular browsers, integrated with layout and server side (backend).
- Developed ecosystem. There are a large number of ready-made solutions in the public domain.
- Rationality and ease of use.
- High level of usability.
- Ease of learning. You get used to the syntax quickly.
The language also has a number of shortcomings, which, if desired, can be circumvented.
- The need for additional frameworks, libraries . Choosing the right tools is not an easy task. It is possible to understand whether the chosen library is suitable for solving a particular problem only after its preliminary study.
- Careless handling of variables, data types . A minor typo can break the entire program. For example, var Number = 100; Number = Numbe + 1; The script will report the presence of a typo only during the development of the program code. A similar problem will arise if the programmer confuses the register. One more example. The programmer decided to write a number to a variable that already contains a string. There will be no error message in this case. But the result will be far from expectations. You can avoid the problems listed above by using code editors. The most popular option is Visual Studio Code.
- Not suitable for developing network applications (software responsible for the correct operation of enterprise computer networks).
Demand for the language
W3Techs counts the number of projects implemented using a particular technology. JS has no competitors. In the section of client interfaces, this is the most requested tool.
JS has been widely used in the creation of mobile applications, backend development, and desktop programs. The phenomenal growth in the demand for the JS language is also facilitated by the tendency to increase the interactivity of sites.
Before learning the syntax of a language, you should understand its main purpose. Most often, JS is used when it is necessary to make a browser-based application, to give the Internet resource more “mobility”.
- Games, web applications . For example, the Gmail client, Google Maps are made with JS. To create a walker, you can use HTML5, JS and a ready-made library.
- Browser Extensions . You can write your own activity counter or a program that will keep track of how much time is spent performing certain actions.
- Web server . In the backend environment, JS competes with Python, PHP, and other languages. The main advantage is the ability to develop the client and server parts in the same language. To create a JS backend, developers use the Node.js engine.
- Desktop (desktop applications) .
- transfer learning;
- previously trained model;
- developing your own model.
Consider, as an example, the use of a previously trained model. Suppose we need to develop a website that will analyze pictures and select those that show a cat. MobileNet is a popular image classifier. It is available in trained model format from Tensorflow.js. The following code will appear on the site:
Add MobileNet and Tensorflow.js to the head of the HTML code.
The body specifies the element of the drawing used for the analysis.
The output will be an array with three predictions. The most likely outcome will be listed first. This is how you can use an already trained model with Tensorflow.js. You need to understand that it may take time for it to load in the browser. Sometimes it reaches 10 seconds.
- Case sensitive. There is a huge difference between Func() and func() functions.
- Presence of built-in operations and objects.
- The need for a semicolon after operators.
- Insensitive to spaces. You can use a different number of indents to format the code.
- First of all, you need to get acquainted with HTML and CSS. You should not start creating sites, applications, forms and other things for the Internet without knowing the basics.
- Study new literature. Information technology is developing, so do not neglect updates.
- Try to write all parts of the program yourself. If you had to borrow someone else’s code, carefully study each line.
- Use debugging. The most important skill of any experienced programmer is to quickly find errors and shortcomings.
- Write beautiful code. Do not ignore formatting standards. Of course, the number of spaces or indents will not affect the quality of the script, but it will become more understandable and readable. Here is a snippet of bad code.
- Try to comment on important actions.
Useful information for professional front-end developers
- Efficient and smart rendering that only redraws components when necessary (if state changes).
- Intuitive and very simple philosophy for declaring states, views. The code becomes readable, beautiful and easy to debug.
In simpler terms, React bridges the gap between JS and HTML. React JS fundamental course from A to Z: https://youtu.be/GNrdg3PzpJQ Few people write pure CSS these days. It has become a necessity for professional front-end developers to learn languages like Less or Sass. Another recommendation is to explore the available ways to build responsive pages. This is due to the large number of form factors of a wide variety of devices (tablets, smartphones, PCs, and so on). There are many JS and CSS libraries available that easily handle this kind of task. Most of them are based on Google’s Material Design guidelines. There are related libraries and topics that you should pay attention to:
- for JSON Web Token authorization;
- for modular Webpack build;
- for data sampling and work with Redux, Relay, Flux streams.
A large number of libraries are also available for optimizing the level of performance, debugging, and managing created projects. Today, in order to become a popular and effective front-end developer, one should study not only the fundamentals, but also be able to choose / apply the achievements of other specialists, which are designed in the form of libraries / frameworks. With their help, the workflow will go much faster.