Home > Article > Web Front-end > Ten concepts every JavaScript developer should know
There are many people learning JavaScript and web development now, and they all hope to get a job based on it. However, self-study often leaves learners with knowledge blind spots in their understanding of the JavaScript language itself.
In fact, it is surprising that they only need to master very little knowledge of the language to create complex web pages, but this usually does not provide a good grasp of the basics of JavaScript.
It is quite easy to use basic skills to implement functionality and avoid complex requirements, and it is also very easy to create a website by relying on Stack Overflow without understanding the copied code.
But the problem is that when many technology companies ask questions in interviews, the purpose is to test whether you really understand JavaScript. When a candidate has only a superficial knowledge of JavaScript, rather than a deep understanding of the language, the interviewer will quickly understand what is going on.
Here are some common concepts used in web development interviews. Of course, we assume that you are already familiar with basic concepts such as loops, functions, and callbacks.
Understand how objects, arrays and functions are copied and passed into functions. Understand what the reference value is copied and understand that the original value is copied and passed by copying the value.
Understand the differences between global scope, function scope and block-level scope. Understand where variables are available and understand how the JavaScript engine performs variable lookups.
Recognize that the declaration of variables and functions will be hoisted to the context in which they are declared, that is, within the scope of the variable. No matter where the variable is declared, it will be Promoted to the top of the scope, but the order of variable initialization remains unchanged. Recognize that function expressions are not promoted.
Recognize that a function retains access to the fields created within it, and realize what this allows us to do, such as data hiding, memoization and dynamic function generation.
Understand the rules of this binding. Know how it works, know how to determine what it's equivalent to in a function, and recognize why it's useful.
Recognize how it relates to object-oriented programming. Understand what happens to functions called via new. Understand how objects that inherit from a function's prototype property are generated by using new.
Understand how these functions work and how to use them. Understand what they do to this.
Understand that inheritance in JavaScript works through the [[Prototype]] chain. Understand how inheritance is set up through functions and objects, and how new helps us achieve this. Learn what the __proto__ and prototype properties are and what they do.
Understand the event loop and how the browser handles user input, web requests and general events. Know how to recognize and correctly implement asynchronous code. Understand what asynchronous and single-threaded are in JavaScript. .
Understand that these functions are first-class objects in JavaScript and what that means, and that it is perfectly legal to return a function from another function of. Understanding the techniques closures and higher-order functions allow us to use.
Do you have anything to add? Share it with everyone in the comment area~
The above content is the concept that ten JavaScript developers should know. I hope it can help everyone.
Related recommendations:
10 interesting JavaScript scripting languages
10 Interesting Javascript and CSS Libraries
The above is the detailed content of Ten concepts every JavaScript developer should know. For more information, please follow other related articles on the PHP Chinese website!