0% found this document useful (0 votes)
3 views6 pages

Java Script

JavaScript is a programming language used for dynamic interactivity on webpages, running in the JavaScript engine within web browsers. It includes various data types, variable declarations, and operators, with specific rules for naming variables and converting data types. The document also covers the use of the JavaScript console for debugging and executing code directly.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Java Script

JavaScript is a programming language used for dynamic interactivity on webpages, running in the JavaScript engine within web browsers. It includes various data types, variable declarations, and operators, with specific rules for naming variables and converting data types. The document also covers the use of the JavaScript console for debugging and executing code directly.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd

Java script

-->programming language
-->used to change the content of a webpage
-->used for dynamic interactivity to a webpage

how the javascript works


-->script tag runs in the javascript engine(engine locates in all the
web browser)
-->follow the process to get the output
-->script-- it contains datas and constants process to follow the
process to instruct the json engine

types of javascript

[Link]
[Link]
[Link]

data types

[Link]-->it has seven datatypes


*number-->decimal and number it is mostly used
for calculation
*string-->character enclosed with double quotes or
single quotes
*boolean-->true or false it is mostly used for
condition making.
*null--> it is assigned when the variable name.
*undefined-->it shows when the value is not assigned to
the variable name
[Link]-primitive

javascript console--> *it displays the output or the messages


*we can found in the development tools that developers can
access directly the javascript engine.
*manually run the code without script tag.
*we can use console tab to check the error in the code
*and also it is used to check the ip address
*the developer can directly access the javascript engine

eg: [Link](“hi hello”);

javascript function

*and it is eclosed with double quotes and also ends with


semicolon.

Variables
*it is the named container to store value.
*can access later
*variables that can store the data that can access and manipulate
through out the program

values: let,const-->keyword for the javascript variables


var-->var is also variable keyword but it is older keyword and
replicated.
Let-->keyword

let uname=”Srikanth”;
*we can reassign the value once its initialize

const-->keyword

const name=”sanjay”
*we cannot reassign the value

variable name convention

camel case-->on the group of words the first letter must be in


small letters and the followed words must be in the capital letter
*it is mostly used in the javascript

pascal case-->all the first letter must be in the capital letters


*it is mostly used in the c++

snake case-->all the words must be in the small letters and also
after the first case must be followed with the undersrcore
*it is mostly used in the python

rules for declaring variable name

[Link] allows char,number but don’t allow space & special character
[Link] must don’t starts with numbers
[Link] sensitive: it must be in lower case and followed by the
uppercase and also it uses only the camal case.

ParseInt--->it is used to convert the string datatype to the integer


datatypes
parseFloat--->it is used to convert the string datatype to the
floating point.
Operators
arithmetic operator

addition + add the values 2+2 4


subtraction - subtract the values 5-3 2
multiplication * multiple the values 3*2 6
division / divide the values 10/2 5
modulus % reminder values 10/3 1
exponential ** power value 3**2 9
increment ++ add one value i++ 29
decrement -- subtract one value i-- 27

compound increment-decrement operator


i+=5; i=i+5;
i-=5; i=i-5;
i++ i=i+1;
i-- i=i-1;

assignment operator

*it is used to assign a value to the variable


eg: a=5;

relational operator
*== is used to check the two values but it only check
the value not check the data type.
*===is also used to check the value but it check both
the value and the datatype.
comparison operator
x=5;
< x<8 true
> x>8 false
>= x=x>=6; false
<= x=x<=8 true

concatenation
*it is used to add two string.
let firstName="prakash";

let lastName="arumugam";

let fullName=firstName+" "+lastName;

[Link](fullName);

type corcin
*automatically convert the values into the different
data types

*when we use + operator it can change the number


into the string
*but in the another arithmetic operator it can convert
the string into the number.

You might also like