Overview Of Javascript .. - Ashutosh

Hot

Post Top Ad

Friday, September 22, 2017

Overview Of Javascript ..

Hello , Everyone Myself ~ Ashutosh. And today you learn about Javascript.. Lets start..



INTRODUCTION


 A scripting language developed by netspace to enable Web authors to design interactive sites. Although it shares many of the features and structures of the full java language , it was developed independently. Javascript can interact with HTML source code, enabling Web authors to spice up their sites with dynamic content.

                  JavaScript is a scripting language  most often used for client-side web development. It was the originating dialect of the ECMA Script standard. It is a dynamic, weakly typed, prototype-based language with first-class functions. JavaScript was influenced by many languages and was designed to look like Java , but be easier for non-programmers to work with.

  Although best known for its uses in websites (as client -side JavaScript ) , Javascript is also used to enable scripting access to objects embedded in other applications (see below)

  JavaScript,despite the name,is essentially unrelated to the Java programming language,although both have the common C syntax , and JavaScript copies many Java names and naming conventions.


History And Naming


JavaScript was originally developed by Brendan Eich of netscape under the name Mocha , which was later renamed to livescript , and finally to JavaScript . The change of name from LiveScript to JavaScript roughly coincided with netscape adding support for java technology in its Netscape Navigator web browser. Javascript was first introduced and deployed in the Netscape browser version 2.0B3 in December 1995. The naming has caused confusion, giving  the impression  that the language is a spin-off of java, and it has been characterized by many as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web-programming language.

Microsoft named its dialect of the language JScript to avoid trademark issues. JScript was first supported in Internet  Explorer version 3.0, released in August 1996,and it included Y2K-Complaint date functions, unlike those based on java.util.Date in JavaScript at the time.The dialects are perceived to be so similar that terms "JavaScript" and "JScript"are often used interchaneably (including in this article). Microsoft , however ,notes dozen of ways in which JScript is not ECMA compliant. Netscape submitted JavaScript to Ecma International for standardization resulting in the standardized version named ECMAScript.



Features


Structured Programming

JavaScript supports all  the structured programming syntax in C (e.g.,if statements , while loops,switch statements,etc.) .One partial exception is scoping: C-style block-level scoping is not supported . JavaScript 1.7,however ,supports block-level scoping with the let keyboard. Like C, JavaScript makes a distinction between expression and statements.

Dynamic Programming

Dynamic typing : 

As in most scripting languages,types are associated with values, not variable. For example , a variable x could be bound to a number , then later rebound to a string. JavaScript supports various ways to test the type of an object , including duck typing.

Objects as associative arrays :

JavaScript is almost entirely object-based .Objects are associative arrays,augmented with prototypes (see below). Object property names are associative array keys: obj.x =10 and obj["x"] =10 are equivalent, the dot notation being merely syntactic sugar. Properties and their values can be added ,changed, or deleted at run-time. The properties of an object can also be enumerated via a for..in loop.

Run-Time evaluation:

JavaScript includes an eval function that can execute statements provided as strings at run-time.


Function programming


First-class Function: 

Functions are first-class; they are objects themselves.As such,they have properties and can be passed around and interacted with like any other object.

Inner functions and closures:

Inner functions (functions defined within other function) are created each time the outer function is involed, and variable of the outer functions for that invocation is finished (e.g, if the innner functionwas returned , it still has access to the outer function's variables ) ---- this is the mechanism behind closures within JavaScript.


Protocol - Based


Prototypes: 

JavaScrilts uses prototypes instead of classes for defining object properties,including methods,and inhertitance. It is possible to stimulate many class-based features with prototypes in JavaScript.

Functions as object constructors:

Functions double as object constructors along with their typical role. prefixing a function call with new creates a new object and calls that function with its local this keyword bound to that invocation. The function's prototype property determines the new object's prototype.


Function as methods: 

Unlike many object-oriented languages. there is no distinction between a function definition and a method definition. Rather,the distinction occurs during functions calling; a function can be called as method. When a function is involved as a method of an object,the function's local this keyword is bound to that object for that invocation.

Others


Run-Time environment: 

JavaScript typically relies on a run-time environment (e.g , in a Web browser) to provide objects and methods by which scripts can interact with "the outside world" . (This is not a language feature per se, but it is common in most JavaScript implementations.)


Variadic Functions

An indefinite number of parameter can be passed to a function. The function can both access them through formal parameters and the local arguments object.

Array and object literals: 

Like many scripting languages,array and objects (associative arrays in other languages) can each be created with a succinct shotcut syntax. In fact, these literals form the basis of the JSON data format.

Regular expressions:


JavaScript also supports regular expressions in a manner similar to perl, which provide a cocise and powerful syntax for text manipulation that is more sophisticsted than the built-in string functions.

                         ************
Written With Heart 💙

Thanks

Created by Ashutosh

Subscribe- ashutosh000.blogspot.com