From e5d1312fdfff301ceb6341bd6c7d7f88c4fa266e Mon Sep 17 00:00:00 2001 From: lo den Date: Tue, 15 Oct 2019 15:01:16 +1100 Subject: [PATCH] praxis --- .DS_Store | Bin 6148 -> 6148 bytes Week2/.DS_Store | Bin 0 -> 6148 bytes Week2/Grade_Calculator.js | 0 Week2/js-exercises/oddOrEven.js | 22 +++++++++++++++++++ Week2/js-exercises/readingList.js | 27 ++++++++++++++++++++++++ Week2/js-exercises/recipeCard.js | 31 +++++++++++++++++++++++++++ Week2/js-exercises/removeComma.js | 21 ++++++++++++++++++ homework/.DS_Store | Bin 0 -> 6148 bytes homework/js-exercises/6.js | 7 ++++++ homework/js-exercises/7.js | 3 +++ homework/js-exercises/8.js | 34 ++++++++++++++++++++++++++++++ 11 files changed, 145 insertions(+) create mode 100644 Week2/.DS_Store create mode 100644 Week2/Grade_Calculator.js create mode 100644 Week2/js-exercises/oddOrEven.js create mode 100644 Week2/js-exercises/readingList.js create mode 100644 Week2/js-exercises/recipeCard.js create mode 100644 Week2/js-exercises/removeComma.js create mode 100644 homework/.DS_Store create mode 100644 homework/js-exercises/6.js create mode 100644 homework/js-exercises/7.js create mode 100644 homework/js-exercises/8.js diff --git a/.DS_Store b/.DS_Store index d06ffd2eacce6d51581b14d992d983569932683d..28d7aad2855060a38d223023ffc09f52e4152c78 100644 GIT binary patch delta 198 zcmZoMXfc@JFUrQiz`)4BAi%&-&XCVg#E_knZWz4Tk$E{|JxGd!Ap z2q82h*>CLm*m+WHkBI2%ep8DqMWjL_DwP@G^sMQ~ofkkYIUZz?JGtH6)ZI*?zc|Ic zSF**vd%2d;{;!69KicqtPd~KndN-^Y|91BD`11UEK9{Q>HsA8wZ|m;Mnxo}I4F-aN zU?3O>27ZhI+}V`s#4!3`AQ%V+J{jQokkE*YV>T>D2f9)M0QrnA0-d!4W0GUzm-%Ggm#HWp45vsKc*u%!bUu S`4SF{hd?1Dx?tcJ7N4ly2(aR2Jbyql>VRN_ z5VED@If?Cfo-|2JL_B+3O^GH%RG|s7C<7wXgG)zlJO;AH*wdOGXi0ap8wm6lrzH0i zx<|g}$i18Yns%F;>3rEX+fL%2+BR)nFE;H0wpDd;_VWDndihoCrd|EWetUb6ODC;R zgMnZm7zhS}fp0T_J6ohWHjF+P2nK?I4+i9XNN9rDu^8&nflf;Rpgf~hpi3@j5*>Eg Wu^37enOApUJOq@G=z@V?VBig8e>2qp literal 0 HcmV?d00001 diff --git a/homework/js-exercises/6.js b/homework/js-exercises/6.js new file mode 100644 index 000000000..ef6add839 --- /dev/null +++ b/homework/js-exercises/6.js @@ -0,0 +1,7 @@ +var animals = []; +console.log('value of the array is undefined, it exists but holds no values'); +console.log(animals); +var threeFaveAnimals = ['Lemur', 'Indris', 'Lion']; +console.log(threeFaveAnimals); +animals.push('Piglet'); +console.log(animals); \ No newline at end of file diff --git a/homework/js-exercises/7.js b/homework/js-exercises/7.js new file mode 100644 index 000000000..f894b8237 --- /dev/null +++ b/homework/js-exercises/7.js @@ -0,0 +1,3 @@ +const mySentence = 'Programming is so interesting!'; + +console.log(mySentence.length); \ No newline at end of file diff --git a/homework/js-exercises/8.js b/homework/js-exercises/8.js new file mode 100644 index 000000000..9dd0b42bc --- /dev/null +++ b/homework/js-exercises/8.js @@ -0,0 +1,34 @@ +const stringOne = 'Hi'; +const stringTwo = 'Bye'; +const objectOne = { + name: 'Cool', + iCanHoldNumbers: 420 +}; +const objectTwo = { + accent: 'English', + iCanHoldBooleans: false +}; + +function testType(d1, d2) { + if (typeof d1 === typeof d2) { + console.log('The two variables are of the same type'); + console.log('D1 is ' + typeof d1 + 'D2 is ' + typeof d2); + } else { + console.log('The two variables are NOT of the same type.'); + console.log('D1 is ' + typeof d1 + 'D2 is ' + typeof d2); + } +} + +testType(stringOne, objectOne); +testType(stringOne, stringTwo); +testType(objectOne, objectTwo); +testType(objectTwo, stringTwo); + +const fruits = ['apple', 'banana', 'pears', 'tomatos']; +const primeNumbers = [1, 2, 3, 5, 7]; + +if (fruits.length === primeNumbers.length) { + console.log('They are the same length. Yay!'); +} else { + console.log('They are not the same length, awww'); +} \ No newline at end of file