├── Day 1 ├── Day 1-1.js └── Day 1-2.js ├── Day 2 ├── Day 2-1.js └── Day 2-2.js ├── Day 3 ├── Day 3-1.js ├── Day 3-2.js └── Day 3-3.js ├── Day 4 ├── Day 4-1.js ├── Day 4-2.js ├── Day 4-3.js └── Day 4-4.js ├── Day 5 ├── button.css └── index.html ├── Day 6 └── index.html └── Day 7 ├── binaryCalculator.js ├── css └── binaryCalculator.css └── index.html /Day 1/Day 1-1.js: -------------------------------------------------------------------------------- 1 | // complete the function 2 | function vowelsAndConsonants(s) { 3 | 4 | var Arr = s.toLowerCase().split( '' ), 5 | c = '', 6 | vArr = ['a','e','i','o','u'], 7 | vowelsResult = "", 8 | consonantsResult = ""; 9 | 10 | for ( c of Arr ){ 11 | if( vArr.indexOf( c )!==-1 ){ 12 | vowelsResult += c + "\n"; 13 | } 14 | else { 15 | consonantsResult += c + "\n"; 16 | } 17 | } 18 | 19 | console.log(vowelsResult+consonantsResult); 20 | } -------------------------------------------------------------------------------- /Day 1/Day 1-2.js: -------------------------------------------------------------------------------- 1 | var re = /^([aeiou]).*\1$/gi; -------------------------------------------------------------------------------- /Day 2/Day 2-1.js: -------------------------------------------------------------------------------- 1 | function processData(my_string) { 2 | try{ 3 | my_string = my_string.split('').reverse().join(''); 4 | console.log(`Reversed string is : ${my_string}`); 5 | }catch (err){ 6 | console.log(`Error : ${err.message}`); 7 | } finally { 8 | console.log(`Type of my_string is : ${typeof my_string}`); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Day 2/Day 2-2.js: -------------------------------------------------------------------------------- 1 | function processData(my_height) { 2 | try{ 3 | if (isNaN(my_height)) { 4 | throw new Error('notANumberError'); 5 | } else if (my_height > 10) { throw new Error( 'hugeHeightError'); 6 | } else if (my_height < 4) { 7 | throw new Error( 'tinyHeightError'); 8 | } else console.log(my_height); 9 | } catch (err) { console.log(err.message); } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /Day 3/Day 3-1.js: -------------------------------------------------------------------------------- 1 | function Car(name, mileage, max_speed) { 2 | this.name = name; 3 | this.mileage = mileage; 4 | this.max_speed = max_speed; 5 | } 6 | -------------------------------------------------------------------------------- /Day 3/Day 3-2.js: -------------------------------------------------------------------------------- 1 | Square.prototype.isSquare = function(){ if(this.A == this.B && this.A == this.C && this.A == this.D){ console.log(true); }else{ console.log(false); } } 2 | -------------------------------------------------------------------------------- /Day 3/Day 3-3.js: -------------------------------------------------------------------------------- 1 | function Alpha(){} 2 | 3 | Alpha.prototype.isAlpha = function(letter){ 4 | return /^[a-zA-Z]$/.test(letter); 5 | }; 6 | 7 | function Vowel(){} 8 | Vowel.prototype = new Alpha(); 9 | 10 | Vowel.prototype.isVowel = function(letter){ 11 | return /^[aeiuoyAEIOUY]$/.test(letter); 12 | }; 13 | 14 | 15 | function Consonant(){} 16 | Consonant.prototype = new Alpha(); 17 | 18 | Consonant.prototype.isConsonant = function(letter){ 19 | return /^[^aeiouyAEIOUY]$/.test(letter); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Day 4/Day 4-1.js: -------------------------------------------------------------------------------- 1 | function multiplier(x) { 2 | return function(y){ return x*y; } 3 | } 4 | -------------------------------------------------------------------------------- /Day 4/Day 4-2.js: -------------------------------------------------------------------------------- 1 | processData = (inputArray) => console.log(inputArray.filter(x => x%2 == 0)); 2 | -------------------------------------------------------------------------------- /Day 4/Day 4-3.js: -------------------------------------------------------------------------------- 1 | let accelerationDueToGravity = pressure(m); 2 | let particleMass = accelerationDueToGravity(g); 3 | let particleHeight = particleMass(h); 4 | 5 | let totalPressure = particleHeight; 6 | -------------------------------------------------------------------------------- /Day 4/Day 4-4.js: -------------------------------------------------------------------------------- 1 | var captcha_check = (function(){ 2 | var actual_captcha = Math.floor(Math.random(100)*Math.pow(10, 5)); 3 | 4 | return { 5 | check: function(guess){ 6 | if(guess === actual_captcha){ 7 | console.log("You have written it correctly."); 8 | } else { 9 | console.log("You have written it incorrectly."); 10 | } 11 | } 12 | } 13 | })(); 14 | 15 | 16 | //Do not edit below this line. 17 | var bot = captcha_check.actual_captcha; 18 | captcha_check.check({}); 19 | console.log(bot); 20 | -------------------------------------------------------------------------------- /Day 5/button.css: -------------------------------------------------------------------------------- 1 | #btn { 2 | width: 96px; 3 | height: 48px; 4 | font-size: 24px; 5 | } 6 | -------------------------------------------------------------------------------- /Day 5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |