// // i am consoling my name // // console.log('hello baraah'); // // console.log('hello bashar');
// single line of comment
/* multiple lines of comments dunia add */
// /* // Datatype: // 1. Strings // - ==> text inside ' ' or " " // - what I write what I see
// 2. Numbers // - integers // - float .... etc
// 3. Boolean // - True // - False // */
// // string // console.log('my name is Riziq'); // console.log('Hello Heros 102d29 +^$% 1224 عربي'); //console.log('Hello Heros 102d29'+'^$% 1224');
// // Numbers //console.log(1); // console.log(1+3+8);
// // Boolean // console.log(true); // console.log(false);
// /* // Operators
// 1. Arithmetic Operators: // + (add) // - (subtract) // *(multiply) // /(divide) // % (mode, reminder) // ** (power to) //++ (increment) //--(decrement)
// /* // 2. Assignment Operators: // // = ==> assign the value to var // += ==>add value to var // -= ==>subtracte value from var // */ // /= // %= // **=
/example:
var x=5
var y =2
console.log(x+=y); /7
//x= x+y
console.log(x) /7
console.log(x-=y);/5
//x=x-y
console.log(x) /5
console.log(x=y); /10
//x=x*y
console.log(x) /10 */
// 3. Comparison Operators [True or False] // == (the value) // === (the value and the Datatype) // < // > // <= // >= // != not equal value // !== not equal value and type // */
/*4.logical Operators && /and || /or ! /not */
/* 5. string Operators
/ // concatenation ==> I will use it to add 2 strings together , add space btw the words // console.log('hello' +' '+ 'Ibrahim'); // // , in the console to add strings with space
var txt1 = 'John'; var txt2 = 'Doe'; var txt3 = txt1 + ' ' + txt2; o/p Joun Doe
var txt1 = 'What a very'; txt1 += 'nice day'; o/p What a very nice day */
// Variable: // var in js is used to store values // var theName='Sanaa';
/* Variable // var theName='Sultan'; // console.log(theName); // // rule to name the var [start only with letters, underscore and $] // var $sultanIdea='hello underscore'; // console.log( $sultanIdea);
*/
/examoles of operators : // // addition // console.log('adding',1+2+6+100); // // subtract // console.log('subtract',499-9-44); // // multiply // console.log(68); // // divide // console.log(500/10); // // mode // console.log(8%2); // console.log(5%2);
// // power // console.log(2**100); /
// // = // var $sultanIdea='hello underscore';
// // += // var theNumber=3; // // console.log(theNumber+=theNumber); // console.log(theNumber=theNumber + theNumber); //6
// // the value comparing // console.log(34 == '34'); //true
// // the value and Datatype // console.log(3 === '3'); // false // console.log(3 === 3); // true
// // != // console.log(3 != '3'); //false // console.log(3 !== '3'); //true