CSS Notes CH 1
CSS Notes CH 1
CODE-22519
Examination Scheme
Theory-100
Practical-50
COURSE OUTCOMES(COs)
a) Create interactive web pages using program flow control structure.
b) Implement arrays and functions in javascript.
c) Create event based web forms using javascript.
d) Use javascript for handling cookies.
e) create interactive webpages using regiular expressions for validations.
f) Create menus and navigations in web pages
Unit-1 Basics of Javascript Programming
Total-12 Marks
• Property
Detailing regarding Object .
Example: const person={first_name:”John”};
Explanation: where,
const=Data type whose value remains constant.
person=Object Name
{ }=having list of properties.
first_name=variable name
john=value
Unit-1 Basics of Javascript Programming
• Method
To use and manipulate data which is stored in object.
works like functions.
Example: object.assign(target,source)
Explanation:where,
object=keyword
. =operator to assign values
assign=keyword to assign data
target= object name in which we want to add
properties.
source=object name from which we want to add
Unit-1 Basics of Javascript Programming
• Dot syntax:
To access the properties in Javascript.
Example:var cat={name:julie,age:5};
Explanation:where,
var= datatype
cat= object name
name,age= properties of object
julie, 5= values of properties
Unit-1 Basics of Javascript Programming
• Main Event:
Also called as actions.
Example:
onclick
onmouseover
onmouseout
onchange
onsubmit
Unit-1 Basics of Javascript Programming
• 1.4 Operators:
Arithmetic operators: +, -, *, /, %, ++, --
Assignment operators: =, +=, -=, *=, /=
Comparison operator: ==, !=, >, <, >=, <=
Conditional operator: (condition)?x:y
Logical operators: &&, ||, !
Unit-1 Basics of Javascript Programming
• Expression:
Primary Expressions: Combination of variables,values,operators.
Example: 5*10
Object and Array intializers:
Example: sports=[‘cricket’, ‘football’, ‘hockey’]
Function definition expression:
function fun_name(parameters)
{
}
Unit-1 Basics of Javascript Programming
• 1.5 If statement
if(condition)
{
}
if(condition)
{
}
else{
}
Unit-1 Basics of Javascript Programming
if(condition1){
}
elseif(condition2)
{
}
else{
}
Unit-1 Basics of Javascript Programming
• 1.6 Switch case statement:
Syntax: switch(expression){
case x:
//code
break;
case y:
//code
break;
default:
//code block
}
Unit-1 Basics of Javascript Programming
continue statement:
Loop through a block of code, but skip the value of specified number.
Example: let text= “ ”;
for(let i=0; i<5; i++)
{
if(i==3){
continue;
text+= i+ “<br>”;
}
Unit-1 Basics of Javascript Programming