ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Presented By:
Assem Salem
Mahmoud Bahaa El-Din
SCCI'15 - Devology - Session 4 Javascript
Variables
var variable_name;
var variable_name = ¡°value¡±;
variable_name=¡°value¡±;
Operators
+ - * / %
Adding Strings: Adding Values:
var moderator =¡°Bahaa¡±;
var Moderator= ¡°Assem¡±;
var show_names= moderator + ¡° ¡± +
Moderator;
var x = 10;
var y = 1;
x++;
y--;
var z = x % y ;
document.write(z);
Comments
//any comment you want
/*
More than one line
*/
If..else
if (conditon){
Some code;
}else{
Some code
}
var x = 6;
var text;
if (x==5){
text = "x equals 5.";
}else{
text = "x does not equal 5.";
}
document.write(text);
LoopsWhile loop:
var i = 0 , x = 1 , sum= 0;
While(i<5){
x++;
sum+=x;
i++;
}
document.write(sum);
LoopsFor loop:
var x = 15;
var sum=0;
for (i=0;i<5;i++){
x++;
sum+=x;
}
document.write(sum);
Activity time
Let¡¯s
CODE
Any Questions?
Thank you

More Related Content

SCCI'15 - Devology - Session 4 Javascript