Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What must be mastered before becoming an JS expert

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what must be mastered before becoming an JS expert". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what you must master before becoming an JS expert".

This and Global

"this" is one of the most confusing things about Javascript. In ES2020, we get "globalThis", which undoubtedly helps to simplify things and establish a clear distinction between other "this".

The reason for getting "globalThis" is that in browsers, global is a "window", in NodeJs it is "global", and inside worker is "self". What a mess, huh?

Some languages (such as swift and python) call it "self", while others (such as Java) call it "this", while Javascript "this" behaves differently.

"this" can refer to an instance of an object or class. It also varies depending on how the function is called. It is your context and can change in both strict and non-strict modes. Do you need more reasons to really try to master it?

Object

Everything in Javascript is an object. This should be the only reason to seek to master objects using Javascript, but let me tell you more.

Class and Array are two examples of things, and they are just underlying objects. To understand objects, you need to understand the prototype nature of Javascript, including prototype inheritance and prototypes.

These properties make Javascript so flexible and are one of the core reasons why you can do almost anything with Java. Every library and tool you use uses object prototypes in the background, which makes you want to create something.

Class

Once you have mastered the object, you must master the Class, which is just the object and the underlying constructor.

When you understand objects, you will understand the limitations and power of the Javascript class. If you come from an object-oriented language or are a fan of object-oriented programming, introducing classes can make the whole possible.

Classes have become the preferred way for developers to avoid using the weird archetypal nature of Javascript and focus only on what they are building.

Scope and closure

I was shocked when I tried to explain scope and closures to someone. People are often confused by them and do not realize how scopes have many requirements on how to execute code in a given context.

For me, the scope is about creating boxes, and closures are just a special box. I actually created a video to try to explain it. Let me know what you think?

Knowing the scope will help you create code that can be used together, and if you like the idea of encapsulation and functional programming, closures are just powerful tools you should use.

Data structure

This is a big topic, but without understanding the data structure, I can't do what I do today, and I can't understand how to create something on Web.

Is this an important topic in any language, especially in Java, where arrays are not actually arrays?

Understanding the data structure is the engineer's way of thinking. This is a piece of knowledge that really distinguishes you from other developers.

Single threaded, non-blocking, asynchronous, concurrent

This is almost the definition of Javascript, and understand that it means something professional.

Knowing why Javascript is single-threaded will tell you which application it is more suitable for.

I actually read a good article, but I suggest you really study the title of this section and be familiar with the language.

Promise and Asynchronous waiting

Whenever I write code in other languages, nothing plays more than I do except promise and async-await, and I like Javascript Promise and Async await.

This is what you need to understand how Javascript works. Commitment is magical, and it provides many purposes for asynchronous programming.

Promises and async... Await allows you to deviate from the traditional linear way of executing programs, which makes it more powerful and faster for single-threaded languages like Javascript, without having to spend a lot of resources to create dedicated threads.

Promises + single threading makes Javascript one of the best choices for building fast and reliable Rest Api and real-time communication applications.

Functional programming

I don't think there is anything better than Javascript's function. It checks each box, which is the second most powerful language after Objects.

Because Javascript is so flexible and rich, it allows you to program in any style, one of which is functional programming.

You can do anything with functions, and the skills associated with functions are endless. If you like functional or any other declarative programming, you must master functions.

Control flow

This is the foundation of any language. Learning how to work step by step will enable you to combine simple to complex algorithms, allowing you to create more complex programs.

The control flow is understanding how to execute things step by step and how it affects the structure. Even if you don't write an application, it will help you debug and understand any application quickly.

Network requests and Ajax

At some point, you will need to make a request, and processing data obtained over the network is an essential skill, especially now that data is an important part of any application.

It will be convenient to learn how to use fetch or XHR API, but you are not limited to this kind of native API. The goal is to understand how you get data over the network in your application.

At some point, you will have to deal with a large data load or applications that rely on a large amount of data.

Thank you for your reading, the above is the content of "what must be mastered before becoming an JS expert". After the study of this article, I believe you have a deeper understanding of what you must master before becoming an JS expert, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report