Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
85 views

Javascript Notes by Akhilesh Sharma

JavaScript was created by Brendan Eich in 1995 and named JavaScript initially before being renamed. It is now known as ECMAScript and maintained by TC-39. JavaScript is one of the most widely used programming languages due to its versatility and ability to run in any browser.

Uploaded by

JUST EASY STEPS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

Javascript Notes by Akhilesh Sharma

JavaScript was created by Brendan Eich in 1995 and named JavaScript initially before being renamed. It is now known as ECMAScript and maintained by TC-39. JavaScript is one of the most widely used programming languages due to its versatility and ability to run in any browser.

Uploaded by

JUST EASY STEPS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

JavaScript notes by Akhilesh Sharma

 JS - JS is one of the most powerful programming languages,


 approx. 98.52% soft wares and websites use JS.
 JS has a broad field in software development as well as web
development.

 JS is created by Brenden Eich in 1995.when he was an employee


at Netscape.
 JS is created in 10 days .
 initial name of JS is mocha then it termed as live script ,due to
some copyrights issue its name changed from live script to
JavaScript to attracts the people towards it ,it use java as prefix.
 Now JavaScript is known by the name of ECMA Script.
 ECMA stand for European, computer manufacturer’s association.
 JS is maintained by TC-39 of ECMA Script.

FEATURES:

 it is a glue language.
 it is simple to use and learn.
 it is interpreted language.
 it id platform independent ,
 it is light weight language,
 it is loosely typed language,
 it has rich set of libraries.
AREA OF JS:

Front-end development –Facebook , netflix,etc.

Backend development – Uber , PayPal , bbc, Netflix, etc.

Mobile app development – Instagram , candy crush saga , etc.

desktop application development - Skype, VsCode etc.

Browser extensions , embedded systems, machine learning , iot and


many more.

Basic concept:

 Window is the root of JS , initiated by browser's window which is


also an object.
 document is the html file and it comes under the window object
hence the object is the main library of Object class.
 when we write document.write(); then it writes the text in the
document file inside body tag.
 console is the testing window comes with browser. when we
write something inside console.log(); then it appears inside the
console window of browser.
 console is used to track errors and it also helps in finding the error
in program of JS and also helps in debugging of program.
 console.warn() is the function that displays the warning which u
want to show during the debugging phase.
 window.prompt() is the function which initiate the input facility ,
by using it u can take input from the user.
 window .alert() is the function which helps to show alert during
the program to the user.
Data types

There are three basic data types in JS.

Number : includes the numeric value i.e. float ,integer .

Ex:1) let num=25;

2) let num1=25.8;

3) let num2=-335.4;

string : string is the collection of words or characters , denoted by


double quotes or single quotes or also by tilde.

Ex: 1) let str=”this is the best place to live”;

2) let str1=’keyboard is peripheral device’;

3) let str3=` today is the best day of my life`; -> tilde notation ` `

Boolean : it has only two values true or false

u can find the type of data type by using typeof();

ex: let a = “Akhilesh”;

console.log(typeof(a)); -> return String as type

Operators:

Arithmetic: + , - , * , / , %
Unary: ++ , --

++ Increment operator. Increase operand value by one.


-- Decrement operator. Decrease value by one.

Comparison: ==, === , != , <= , >= , > , <.

== compares the value of two operands.

=== It compares the value as well as data types of the values.

!= Compares inequality of two operands.

Logical: && , || , !

&& - is known as AND operator. It checks whether two operands are


non-zero (0, false, undefined, null or "" are considered as zero), if yes
then returns 1 otherwise 0.

||- is known as OR operator. It checks whether any one of the two


operands is non-zero (0, false, undefined, null or " " is considered as
zero).

! - is known as NOT operator. It reverses the Boolean result of the


operand (or condition)
Ternary: (condition) ? True statement: false statement;

String: collection of words or characters. Some useful methods of string


are as follows.
Ex: let str = “The secret of getting ahead is getting started.” ;
let str1=”today is Monday.” ;

-str.length -> gives the length of the string.


Ex : str.length; // output-> 47.

-str.concat () - merge the string two or more strings in single string.


Ex: str.concat(str,str1); // output-> The secret of getting ahead is getting
started today is Monday.

-str.toUpperCase() -change into upper case .

-str.toLowerCase() -> change into lower case.

-
str.slice(start, end) -> gives the part of string u want.

-str.split() -> split the string with , comma. And return an array.

-str.trim() -> removes the white space from start and end of the
string.

-str.match() – find the word in the string and provide output in array.
Array: Array is a collection of similar or different types of elements.
Some most important methods of array are as –

-push() - add an element in last of array.

-pop() - remove an ekement from last of array.

-shift() -remove an element from the first position


-unshift() -add an element at first position in array.

-reverse() -reverse the array

forEach:
Object: An object is a collection of properties, and a property is an
association between a key and a value.

You might also like