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