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

How to get started with js

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

How to start js, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Some friends say they want one to learn javascript, but they don't know how to learn it. In this article, the editor summarizes the important knowledge points and learning methods of JavaScript, which is a little long, but easy to use. I hope it will be helpful to you.

I. Development environment and JavaScript version

The simpler the development environment, the better. Don't waste your time in this part.

First, let's talk about the choice of editors, sublime text, vs code, atom, webstorm, and HBuilder. Beginners always want to find the best editor, in fact, this editor is the same as choosing heroes in the game, there is no the most powerful, only the most suitable for you, if you are still not sure, choose vs code, I think this is very friendly to beginners.

The browser uses chrome, and then you can start playing with the code.

With regard to the JavaScript version, I suggest you start with ES5, and then look at the new features of ES2015+ after you have a certain foundation.

Second, basic grammar

There are many similarities between learning a programming language and learning a natural language. We have to start with the most basic words and grammar.

Variables: how to declare variables, how to assign values to variables. Data type: what is a data type and what is the difference between a number and a string. Operators and expressions: what are the commonly used operators? the difference between "=", "=" and "= =", and so on. Branch statements: if, switch loop statements: for, while functions: what is a function, what is a parameter, what is a return value.

You must be very familiar with these basic grammars, or the follow-up learning will be difficult.

III. Object

Object is a very important concept, and you must master it flexibly:

Object: an unordered collection of attributes, which we call an object method when the property value is a function. Array: an ordered collection of elements. A common way to understand an array date object: get the year, month, day, minute and second mathematical object: get a random number to understand other objects: regular expressions, wrapper objects, in fact, functions are also objects, but you can simply understand them.

There are many methods for each object, these methods just know where to look up, do not memorize, just like when we learn English, we have to memorize the necessary words, but most of the words know to look up in a dictionary.

The process of learning [basic grammar] and [object] is rather boring, and the connection between knowledge points is not particularly close, just as we learn Chinese characters in the first grade of primary school. We know what every word is, but we don't put them together. That's why primary schools practice forming words, making sentences, and then writing essays. We compare the project to writing a composition, so we still have a long way to go, so don't be in a hurry.

4. DOMDOM tree structure node: element node, text node, attribute node relationship: peer, parent-child, etc. Get node: querySelector, querySelectorAll and other node operations: add, delete, change and check event binding: event flow and event delegate should know

DOM also provides a lot of methods, still do not invest too much energy, novice self-study will always be plagued by a large number of methods, what we need to do is to have a general understanding of DOM, as for those messy interfaces, we can use jQuery or framework instead.

(if you are interested in DOM, you can come back to further study after mastering a little more comprehensive skills, but investing a lot of time in the early stage will really affect the efficiency of learning.)

5. JQuery

JQuery is a must, but it is really easy to get started with jQuery. It takes two days to understand the usage of jQuery, and then you can use jQuery to achieve various page effects. It will definitely stumble in the early stage, but there are a lot of jQuery materials, just learn and do it at the same time.

VI. JavaScript advance

Once jQuery is proficient, you can start learning something a little more advanced about JavaScript:

The difference between primitive types and reference types various type conversions and type checking closures: functions set functions, no matter how to cover themselves on the line. Prototype: how constructors, prototype properties, and prototype-based inheritance are implemented. This: you can open a hole to study and study.

7. Learn about node

Node can now be said to be a must-learn at the front end, but instead of learning to use node as the background, we should use various tools under the node ecology to learn about the background by the way node.

Open a static server with node and download the third-party module webpackbabel using npm

It is best to write a simple daemon in express (a server.js is enough) to handle some requests, so that we can write the background interface ourselves when we learn ajax, of course, this requires a basic knowledge of the http protocol.

ES2015+ new feature variables and constants: why abandon var? Structure assignment Arrow function Modular class compilation

Such as the promise,async/await function and so on, depending on your ability, if you are interested in seeing it, it will not affect your later study, but even if you don't learn it now, this follow-up will be made up.

IX. AJAX

To put it simply, take a look at the http protocol, know what a request is and what a response is, but what is different between get and post, and then learn ajax and look at the grammar.

Send a request with XMLHttpRequest and receive a data. Send a request with jQuery and receive a data. Json parsing

It is enough to know these, follow-up whether it is work or study, there will certainly be a lot of problems, and then specific analysis of specific problems.

X. framework

Choose between react, angular and vue. Beginners with zero foundation strongly recommend vue. Angular is recommended if backend is converted to frontend, and react is recommended if technical frontend.

This article is for beginners with zero foundation, so it's better to choose vue.

The road to technology is long, and this is just a starting point.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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