diff --git a/Week1/homework/js-exercises/ArrayAnimals.js b/Week1/homework/js-exercises/ArrayAnimals.js new file mode 100644 index 000000000..cf079bbe1 --- /dev/null +++ b/Week1/homework/js-exercises/ArrayAnimals.js @@ -0,0 +1,8 @@ +"use strict"; +var vehicles = []; +console.log('These are some vehicles.'); +console.log(vehicles); +var favAnimals = ['Cat', 'Dog', 'Elephant']; +console.log(favAnimals); +favAnimals.push('Piglet'); +console.log(favAnimals); \ No newline at end of file diff --git a/Week1/homework/js-exercises/Debugging.js b/Week1/homework/js-exercises/Debugging.js new file mode 100644 index 000000000..c17836088 --- /dev/null +++ b/Week1/homework/js-exercises/Debugging.js @@ -0,0 +1,2 @@ +"use strict"; +console.log('I\'m awesome'); \ No newline at end of file diff --git a/Week1/homework/js-exercises/HelloWorld.js b/Week1/homework/js-exercises/HelloWorld.js new file mode 100644 index 000000000..98ed1d09f --- /dev/null +++ b/Week1/homework/js-exercises/HelloWorld.js @@ -0,0 +1,14 @@ +"use strict"; +console.log("Hello world!"); //English +console.log("Merhaba dunya!"); //Turkish +console.log("Halo dunia!"); //Indonesian +console.log("Ciao mondo!"); //Italian +console.log("Hola mundo!"); //Spanish +console.log("Hallo wereld!"); //Dutch +console.log("Bonjour le monde!"); //French +console.log("salve mundi!"); //Latin +console.log("Hallo welt!"); //German +console.log("Salamu dunia!"); //Swahili + + + diff --git a/Week1/homework/js-exercises/LengthString.js b/Week1/homework/js-exercises/LengthString.js new file mode 100644 index 000000000..e59ad8e42 --- /dev/null +++ b/Week1/homework/js-exercises/LengthString.js @@ -0,0 +1,4 @@ +"use strict"; +var mySentence = 'Programming is so interesting!'; +var lngth = mySentence.length; +console.log(lngth); \ No newline at end of file diff --git a/Week1/homework/js-exercises/LogNumber.js b/Week1/homework/js-exercises/LogNumber.js new file mode 100644 index 000000000..e5ab9427a --- /dev/null +++ b/Week1/homework/js-exercises/LogNumber.js @@ -0,0 +1,7 @@ +"use strict"; +var numberX; +console.log('Value of x is his age'); +console.log(numberX); +numberX = 32; +console.log('Value of numberX is age of someone else.'); +console.log(numberX); \ No newline at end of file diff --git a/Week1/homework/js-exercises/LogString.js b/Week1/homework/js-exercises/LogString.js new file mode 100644 index 000000000..961c4ed16 --- /dev/null +++ b/Week1/homework/js-exercises/LogString.js @@ -0,0 +1,7 @@ +"use strict"; +var myString = 'Fatih Ucar'; +console.log('This is my name.'); +console.log(myString); +myString = 'To Kill a Mockingbird'; +console.log('This is a great book.'); +console.log(myString); diff --git a/Week1/homework/js-exercises/RoundNumber.js b/Week1/homework/js-exercises/RoundNumber.js new file mode 100644 index 000000000..0cba008e8 --- /dev/null +++ b/Week1/homework/js-exercises/RoundNumber.js @@ -0,0 +1,7 @@ +"use strict"; +var z = 7.25; +console.log(z); +var a = (Math.round(z)); +console.log(a); +Math.max(z, a); +console.log(Math.max(z, a)); \ No newline at end of file diff --git a/Week1/homework/js-exercises/TypeChecker.js b/Week1/homework/js-exercises/TypeChecker.js new file mode 100644 index 000000000..60ccf80d6 --- /dev/null +++ b/Week1/homework/js-exercises/TypeChecker.js @@ -0,0 +1,44 @@ +"use strict"; +let book = 'It was the best of times'; +let song = 'In the year 2525'; +let person = {firstName:"John", lastName:"Wick", age:40, eyeColor:"green"}; +let animal = {type:'cat', name:'Silly', color:'white and black'}; + +console.log(typeof 'book'); +console.log(typeof 'animal'); + +if (typeof 'book' === typeof 'song') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +}; + +if (typeof 'book' === typeof 'person') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +}; + +if (typeof 'book' === typeof 'animal') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +}; + +if (typeof 'song' === typeof 'person') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +}; + +if (typeof 'song' === typeof 'animal') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +}; + +if (typeof 'person' === typeof 'animal') { + console.log('SAME TYPE') +} else { + console.log('Not the same') +};