Summary of JavaScript practice

Source: Internet
Author: User


The simple knowledge of JavaScript has been summarized above. You are welcome to exchange and learn. The learning relies on theory + practice. Through the Javascript special training by Mr. Jiang Hao, you have deepened your understanding of the theoretical knowledge, learning new languages is getting more and more familiar with the background. The basic content is so familiar and the syntax is similar. Apart from common points, different knowledge points are just not familiar to us, it is not difficult to strengthen practical practices and break through individual attacks. This means that variables, types, statements (methods), and structures are quite familiar with the previous knowledge (VB, therefore, it is not a new language, and there is not much burden in mind. It is most important to practice more.




Examples:

Javascript isObject-based)Language, almost all things we encounter are objects. Because Javascript isPrototype-based object-oriented language, NoClassSo Javascript is not a real object-oriented programming language.


In C ++ or C #, objects refer to instances of classes or structures. Objects have different attributes and methods, depending on the templates (class) That instantiate them ). This is not the case with JavaScript objects. In JavaScript, an object is only a group of name/value pairs. That is to say, JavaScript objects are treated as dictionaries containing string keywords. We can use the familiar "." (vertex) operator or the "[]" operator to obtain and set the attributes of an object. This is a common method when processing a dictionary. The following code snippet
var userObject = new Object();userObject.lastLoginTime = new Date();alert(userObject.lastLoginTime);    


And the following code snippet:

var userObject = {}; // equivalent to new Object()userObject[“lastLoginTime”] = new Date();alert(userObject[“lastLoginTime”]);


Javascript has a lot of knowledge to learn. It's just getting started now. Next, let's take a closer look! Hope!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.