diff --git a/Week1/homework/js-exercises/LogString.js b/Week1/homework/js-exercises/LogString.js new file mode 100644 index 000000000..442b7490e --- /dev/null +++ b/Week1/homework/js-exercises/LogString.js @@ -0,0 +1,7 @@ +let myString = "Enwer Memet"; +console.log(`my fullname`); +console.log(myString); + +myString = "love you"; +console.log('love'); +console.log(myString); \ No newline at end of file diff --git a/Week1/homework/js-exercises/RoundNumber.js b/Week1/homework/js-exercises/RoundNumber.js new file mode 100644 index 000000000..5d20b2529 --- /dev/null +++ b/Week1/homework/js-exercises/RoundNumber.js @@ -0,0 +1,10 @@ +let z = 7.25; +console.log(z); + +let a = (Math.round(z)); +console.log(a); + + +const highestValue = (Math.max(a,z)); +console.log(highestValue); + diff --git a/Week1/homework/js-exercises/arrayOfAnimals.js b/Week1/homework/js-exercises/arrayOfAnimals.js new file mode 100644 index 000000000..e7794c30e --- /dev/null +++ b/Week1/homework/js-exercises/arrayOfAnimals.js @@ -0,0 +1,11 @@ +let animals=[]; +console.log(`an empty array`); +console.log(animals); + +let myPets = ["cat", "horse", "sheep"]; +console.log(myPets); + + +myPets.push('Piglet'); +console.log(myPets); + diff --git a/Week1/homework/js-exercises/compareArray.js b/Week1/homework/js-exercises/compareArray.js new file mode 100644 index 000000000..4aa88039c --- /dev/null +++ b/Week1/homework/js-exercises/compareArray.js @@ -0,0 +1,19 @@ +'use strict' +let names=['Nur','gul','tur','yuri']; +let numbers=[1,2,3,4,5,6,7]; + +console.log('The length of the array is ' + names.length); +// console.log(names.length); +console.log('The length of the array is ' + numbers.length); +// console.log(numbers.length); + +let compare = names.length === numbers.length; +console.log(compare); + + +if (names.length === numbers.length) { + console.log('They are the same!'); +} else { + console.log('Two different sizes'); +} + diff --git a/Week1/homework/js-exercises/errorDebugging.js b/Week1/homework/js-exercises/errorDebugging.js new file mode 100644 index 000000000..7137b6fb3 --- /dev/null +++ b/Week1/homework/js-exercises/errorDebugging.js @@ -0,0 +1,6 @@ +// console.log('I'm awesome'); //find error +// changes single queto to double queto +console.log("I'm awesome"); +// or +console.log('I\'m awesome'); +console.log(`I'm awesome`); diff --git a/Week1/homework/js-exercises/index.html b/Week1/homework/js-exercises/index.html new file mode 100644 index 000000000..45c2294cc --- /dev/null +++ b/Week1/homework/js-exercises/index.html @@ -0,0 +1,22 @@ + + + + + + + js-exersize + + +

salam

+ + + + + + + + + + + + \ No newline at end of file diff --git a/Week1/homework/js-exercises/lengthString.js b/Week1/homework/js-exercises/lengthString.js new file mode 100644 index 000000000..dcc63f508 --- /dev/null +++ b/Week1/homework/js-exercises/lengthString.js @@ -0,0 +1,8 @@ +'use strict' +let mySentence ="Programming is so interesting!"; +let length=mySentence.length; +console.log(length); + +// or +// console.log(mySentence.length); +// document.write(mySentence.length); \ No newline at end of file diff --git a/Week1/homework/js-exercises/logHello.js b/Week1/homework/js-exercises/logHello.js new file mode 100644 index 000000000..a6e0c4d11 --- /dev/null +++ b/Week1/homework/js-exercises/logHello.js @@ -0,0 +1,16 @@ +'use strict' +console.log('Hello' + " " + 'world!'); //english +console.log('Selam ' + " " + 'Dünya'); //turkish +console.log('salve ' + " " + 'mundi!'); //xxx +console.log('こんにちは' + " " + '世界!'); //japanese +console.log('안녕 ' + " " + '세상!'); //korean +console.log('Hallo' + " " + 'wereld!'); //dutch +console.log('مرحبا' + " " + 'عالم!'); //arabic +console.log('سلام' + " " + 'دنیا!'); //iranian +console.log('سالام' + " " + 'دۇنيا!'); //uyghur +console.log('ciao' + " " + 'mondo!'); //xgy + + + + + diff --git a/Week1/homework/js-exercises/lognumber.js b/Week1/homework/js-exercises/lognumber.js new file mode 100644 index 000000000..ed23a1711 --- /dev/null +++ b/Week1/homework/js-exercises/lognumber.js @@ -0,0 +1,8 @@ +'use strict'; +let x; +console.log('I think the value of x is undifined'); +console.log(x); + +x = 12; +console.log(`i think it's an integer, its value is 12`); +console.log(x); \ No newline at end of file diff --git a/Week1/homework/js-exercises/remainder.js b/Week1/homework/js-exercises/remainder.js new file mode 100644 index 000000000..a662d18f5 --- /dev/null +++ b/Week1/homework/js-exercises/remainder.js @@ -0,0 +1,20 @@ +'use strict' +let x = 7; +x = x % 3; +x %= 3;// 7-3-3=1 +console.log(x); + + +let y = 21; +y = y % 4; +y %= 4;// 21-4-4-4-4-4=1; +console.log(y); + + +let z = 13; +z = z % 2; +z %= 2;// 13-2-2-2-2-2-2=1 +console.log(z); + + + diff --git a/Week1/homework/js-exercises/typeChecker.js b/Week1/homework/js-exercises/typeChecker.js new file mode 100644 index 000000000..c12756f92 --- /dev/null +++ b/Week1/homework/js-exercises/typeChecker.js @@ -0,0 +1,53 @@ +'use strict' +let fruit = 'apple'; +let user = 'enwer'; +const car = { type: "Fiat", model: "500", color: "white" }; +const team = { type: "lakers", model: "1990", color: "yellow" }; + +if (typeof fruit === typeof user) { + console.log('fruit and user : SAME TYPE') +} +else { + console.log('fruit and user: Not the same...') +} + + +if (typeof fruit === typeof car) { + console.log('fruit and car : SAME TYPE') +} +else { + console.log('fruit and car: Not the same...') +} + + +if (typeof fruit === typeof team) { + console.log('fruit and team : SAME TYPE') +} +else { + console.log('fruit and team: Not the same...') +} + + +if (typeof fruit === typeof user) { + console.log('fruit and user : SAME TYPE') +} +else { + console.log('fruit and user: Not the same...') +} + + +if (typeof team === typeof user) { + console.log('team and user : SAME TYPE') +} +else { + console.log('team and user: Not the same...') +} + + +if (typeof car === typeof team) { + console.log('car and team : SAME TYPE') +} +else { + console.log('car and team: Not the same...') +} + diff --git a/Week2/LESSONPLAN.md b/Week2/LESSONPLAN.md index ebe0a6342..c495f49a3 100644 --- a/Week2/LESSONPLAN.md +++ b/Week2/LESSONPLAN.md @@ -70,6 +70,40 @@ if (s2 == s1) { } ``` +let statement=[ + let s = "Hello".toLowerCase(); + let l = s.length; + + +function sum(a, b) { + return a + b; +} +let max = function (a, b) { + return a > b ? a : b; +} + +let s1 = sum(4, 5); +let s2 = 4 + 5; + +if (s2 == s1) { + console.log("same"); +} else { + console.log("not same"); +} +] + +let expression =[ + "Hello".toLowerCase() + + s.length + + sum(4, 5) + + function (a, b) + + return a + b +] + List all 11 *statements* in the code above List all 28 *expressions* in the code above (BONUS!) diff --git a/Week2/playground.js b/Week2/playground.js new file mode 100644 index 000000000..0ace398ee --- /dev/null +++ b/Week2/playground.js @@ -0,0 +1,9 @@ +let shoes = `green`; +let shirt = `green`; +let pants = `green`; + +if (shoes === `green` && shoes === `green` && pants === `green`){ +console.log('they are green'); +} + +