What is javascript ?, Javascript

Source: Internet
Author: User

What is javascript ?, Javascript

JavaScript is a scripting language

JavaScript is a lightweight programming language.

JavaScript is the programming code that can insert HTML pages.

After JavaScript is inserted into the HTML page, it can be executed by all modern browsers.

JavaScript is easy to learn.



What is javascript?

JavaScript is an interpreted (not compiled) scripting language. It has the following main features: Object-oriented, weak type, dynamic, and prototype-based object-oriented (object) (not class-based)

Java is a class-based object-oriented language and a compilation language.

1). interpreted (not compiled)

LAfter the code is compiled, it does not need to be compiled. It is directly parsed and executed by the js parsing engine (dynamic performance is better, but the overhead is large)

2). Weak type

LWhen declaring a variable, you do not need to specify its data type, and it can be assigned any type of data at any time. The Interpreter automatically shapes the variable according to the context.


<!DOCTYPE html>

3). Object-oriented

LIn JavaScript, "Everything is an object". In this respect, it is more thorough than other OO languages. Even as a function of the Code itself, it is also an object, the boundaries between data and code are already quite vague in JavaScript.


4). Dynamic

LThe attributes of an object can be dynamically set after the object is created, and the attribute value can be any type of data (naturally, it can be a function)

After creating an object, we added the school attribute and the getSchool method.


obj.school = "nupt";obj.getSchool = function(){return this.school;};


<!DOCTYPE html>


5). Based on the prototype (object) (not based on the class)

LThere is no real class concept in js. How can we reuse code ?, That is prototype.



Use {} to create an object

Name and age are the properties of the obj object. getName and getAge are the member functions of the obj object.

Note: The attribute and value areColon

A colon is a separator key and value used to separate attribute names and attribute values.

Between an attribute and an attribute isCommaInsteadSemicolon!


<!DOCTYPE html>


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.