2. INTRODUCTION
JavaScript is a scripting language with first
class functioning.
Is originally designed for the browser.
It has nothing to do with java.
Enhance the interaction of a user with the
webpage.
3. Was developed by Brendan Eich in 1995.
The language was initially called livescript and was
later renamed javascript.
First version was created in 10 days.
It’s the most popular language on Github.
4. Uses of javascript
In The Browser
Used in making modern webpage/web app.
Desktop
Windows 8 metro UI was built using it.
IOT
JS is becoming the go to language.
Real Time
Launches chat built filly in node.
5. What Can JS Do Today?
Run a VM inside a browser.
Run a game inside the browser.
Serve 300 million users without shooting up the
cpu.
Help in making power point presentation online.
Make real time chat possible.
11. DATATYPES
NUMBER- Has double precision 64 bit format and
uses arithmetic and math operations.
STRINGS - It supports any language and has
many built in functions and properties.
BOOLEAN- Coerce any thing into Boolean using
Boolean().
NULL - It is an assignment value and is used in
absence of value of a variable.
UNDEFINED - If a variable is declared but is not
assigned a value then it has a undefined data
type.
12. OBJECTS
MOST IMPORTANT PART OF JS.EVERYTHING IN
AN OBJECT IS JS.
FUNCTION – All functions have access to special
parameters insides its body like arguments etc.
ARRAYS – Special type of objects has a special
property called length . It is one more than the
highest index of array.
13. OBJECTS
DATE – Exact replica of java date class, lots of
date manipulation function inbuilt. Also lots of
good i18n function.
Reg Exp – Known as regular expression is one of
the least exploited part of javascript and is good
for form validation.
14. Flow Control
JS supports almost every flow control structure.
• If then else
• while
• For
• Switch case
• Break
• Continue
15. ERROR HANDLING
One of the best way to handle errors is to write a
perfect code.
Another best option is to make use of try catches.
try{
Block of code to try
}
catch(err){
Block of code to handle errors
}
This ensures that the rest of the code continues to
execute.
16. SCOPE
Scope is the set of the variables you have access to.
In JS there are mainly two scopes.
• Local Scope
• Global Scope
Any variable declared inside a function using var
keyword
Has a local scope.
Any variable declared outside it has global scope.
*Special Case :Any variable declared inside a function
without the “var” keyword is assumed global and is
assigned to global scope.
This special case is called Automatic Global.
17.
18. Document Object Model
The document object represents the whole html
document.
When html document is loaded in the browser, it
becomes a document object. It is the root
element that represents the html document. It
has properties and methods. By the help of
document object, we can add dynamic content to
our web page.
As mentioned earlier, it is the object of window
We can access and change the contents of
document by its methods.
19. DOM MANIPULATION
The Document Object Model (DOM) represents
that same document so it can be manipulated.
The DOM is an object-oriented representation of
the web page, which can be modified with a
scripting language such as JavaScript. The
W3C DOM and WHATWG DOM standards are
implemented in most modern browsers.
20.
21. JS ON SERVER
Node.js, often referred to as just Node, is a
powerful tool that can run JavaScript
applications on both the server side as well as
the client side. Node.js can be used to write
static file servers, Web application frameworks,
messaging middleware, and servers for HTML5
multiplayer games.