Javascript language Overview

Source: Internet
Author: User
Javascript language Overview

Javascript syntax, operators, and flow-control statements are similar to those in the C language. it has des if, else, switch, break, for, while, do, and return statements which behave almost identically to their C counter-parts. as a result, C programmers can easily read and modify most JavaScript scripts.

Javascript is a loosely-typed language. variables in JavaScript are more flexible than variables in C or Java. variables do not need to be explicitly declared, and the same variable can store different data types at different points within a script. these types are number, String, Boolean value, array, object, function (which is actually an object itself), andNull. Operators automatically convert values between data types as necessary.

Variables can be local to a function or global to the entire JavaScript environment. variable and object names may not contain spaces or punctuation other than "_" or "$ ". in addition, variable and object names can include numbers but must not begin with a number.

JavaScript does not have pointers and does not deal with memory addresses.

Common misconceptions about Javascript

If you 've used JavaScript before, you have probably added scripts to a Web page. it's important to clear up misconceptions some programmers may have about Javascript when used outside the context of web pages:

  • Javascript is a general-purpose, cross-platform programming language. while it was developed for use in Web-browsers, it has a number of features that make it useful for application configuration. it is easy to learn and use, the syntax is similar to C, it is object oriented, and it is widely encoded ented.
  • Javascript is standardized. The language is also called ecmascript, And the ECMA-262 standard defines the language (see http://www.ecma.ch/ecma1/STAND/ECMA-262.HTM). The basic syntax and semantics of the language are stable and standardized.
  • When you use JavaScript in a web page, the objects you use are defined by the Document Object Model (DOM ). these objects include window, document, form, and image. the Dom is not part of the Javascript standard; nor is the DOM partXdcscript.
  • Other object models can be defined for use with JavaScript. Instead of the Dom,XdcscriptOften runs in the context of an "Object Model" containing one or more global objects; for example, configuration scripts are run in a context in which the global variableProgramIs defined.
  • Javascript is not a part of Java. These are two different versions that have similar names for historical marketing reasons. However,XdcscriptDoes allow scripts to call arbitrary Java functions, including any method provided by the standard Java Runtime Environment.
  • For security reasons within Web browsers, JavaScript does not provide built-in support for file services. However, by using UE of providing access to the Java Runtime Environment,XdcscriptHas full access to a complete (and standard) set of file-system services.
  • Rtsc modules run javascript only on the host PC, UNIX, or Linux machine. JavaScript code is not run on the embedded target (yet ).
Basic concept Javascript is a client scripting language based on object and event-driven and relatively secure. It is also a scripting language widely used in client web development. It is often used to add dynamic functions to HTML web pages, such as responding to various user operations. Javascript can also be used in other scenarios, such as server-side programming. The complete JavaScript implementation consists of three parts: ecmascript, Document Object Model, and byte sequence mark. Javascript programs are plain text and do not need to be compiled. Variable

For exampleVaRMyvariable = "some value

Related Article

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.