diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index ae8189517..000000000 --- a/.eslintrc +++ /dev/null @@ -1,47 +0,0 @@ -{ - "env": { - "browser": true, - "commonjs": true, - "es6": true, - "node": true - }, - "parserOptions": { - "ecmaVersion": 2017, - "ecmaFeatures": { - "jsx": true - }, - "sourceType": "module" - }, - "extends": [ - "eslint:recommended" - ], - "rules": { - "no-const-assign": "warn", - "no-this-before-super": "warn", - "no-undef": "warn", - "no-unreachable": "warn", - "no-unused-vars": "warn", - "constructor-super": "warn", - "valid-typeof": "warn", - "no-var": "warn", - "prefer-const": "warn", - "no-multiple-empty-lines": "warn", - "eol-last": [ - "error", - "always" - ], - "no-console": "off", - "camelcase": "warn", - "eqeqeq": [ - "error", - "always", - { - "null": "ignore" - } - ], - "semi": [ - "warn", - "always" - ] - } -} \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6c589c2f8..000000000 --- a/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -.netlify -dist/ diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 38f966ebe..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.formatOnType": true, - "editor.formatOnPaste": true, - "editor.detectIndentation": false, - "editor.tabSize": 2, - "cSpell.words": [ - "Debouncing", - "Maartje", - "blabla", - "codewars", - "keyup", - "maartje's", - "roverjs", - "taalmap", - "trollface" - ] -} \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 79285a5eb..000000000 --- a/LICENSE +++ /dev/null @@ -1,3 +0,0 @@ -This work is licensed under the Creative Commons Attribution 4.0 International License. -To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ -or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. \ No newline at end of file diff --git a/README.md b/README.md index 5da260eb1..57b10aa98 100644 --- a/README.md +++ b/README.md @@ -1,23 +1 @@ -> Please help us improve and share your feedback! If you find better tutorials -or links, please share them by [opening a pull request](https://github.com/HackYourFuture/JavaScript2/pulls). - -# HackYourFuture - JavaScript 2 - -Here you can find course content and homework for the JavaScript2 module - -|Week|Topic|Read|Homework| -|----|-----|----|--------| -|1.|• Capturing user input
• [Events](http://javascript.info/introduction-browser-events)
• [Basic DOM manipulations](../../../fundamentals/blob/master/fundamentals/DOM_manipulation.md)
• [Code debugging using the browser](http://javascript.info/debugging-chrome)
• [Code commenting](../../../fundamentals/blob/master/fundamentals/code_commenting.md)
• Structuring code files
• [Code formatting](../../../fundamentals/blob/master/fundamentals/code_formatting.md)
• [Handing in homework via PR](../../..//fundamentals/blob/master/fundamentals/homework_pr.md) |[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)| -|2.|• Functions + JSON/Arrays
• [Array Manipulations](../../../fundamentals/blob/master/fundamentals/array_manipulation.md)
• JSON
• [Map and filter](../../../fundamentals/blob/master/fundamentals/map_filter.md)
• Arrow functions |[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)| -|3.|• [Closures](../../../fundamentals/blob/master/fundamentals/scope_closures_this.md)
• Callbacks|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)| - -__Kind note:__ - -We expect you to __always__ come prepared to the class on Sunday. - -### Overall -A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](../../../fundamentals/blob/master/fundamentals/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear. - -*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)* - -Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. +#hyfjavascript2 diff --git a/Week1/homework/README.md b/Week1/homework/README.md new file mode 100644 index 000000000..51dd1f199 --- /dev/null +++ b/Week1/homework/README.md @@ -0,0 +1,2 @@ +#js2 +JavaScript2 week1 diff --git a/Week1/homework/app.js b/Week1/homework/app.js index ffef836dc..571bf3498 100644 --- a/Week1/homework/app.js +++ b/Week1/homework/app.js @@ -1,11 +1,113 @@ +//book list i have read 'use strict'; -{ - const bookTitles = [ - // Replace with your own book titles - 'harry_potter_chamber_secrets' + let bookTitles = [ + + 'allison graham_cart to business relationship', + 'bill vincent_apostolic breakthrough', + 'jason kro_web development', + 'shama hoque_full stack react project', + 'cody lindley_front end handbook', + 'adam smith_wealth of nations', + 'hunry potter_chamber of secretes', + 'karl marx_capital', + 'vipul sonpatki_react by example', + 'adam smith_moral sentiments', + ]; + // + // books changed from JSON to multiple ARRAY. + // be careful unique keyword=>"bookInfo" in JSON data format.. +'use strict'; + let books = [ + {bookInfo :{ + title: 'cart to business relationship', + author : 'allison graham', + language : 'english', + }}, + {bookInfo :{ + title: 'apostolic breakthrough', + author : 'bill vincent', + language : 'english', + }}, + {bookInfo :{ + title: 'web development', + author : 'jason kro', + language : 'english', + }}, + {bookInfo :{ + title: 'full stack react project', + author : 'shama hoque', + language : 'english', + }}, + {bookInfo :{ + title: 'front end handbook', + author : 'cody lindley', + language : 'english', + }}, + {bookInfo :{ + title: 'wealth of nations', + author : 'adam smith', + language : 'english', + }}, + {bookInfo :{ + title: 'chamber of secretes', + author : 'hunry potter', + language : 'english', + }}, + {bookInfo :{ + title: 'capital', + author : 'karl marx', + language : 'english', + }}, + {bookInfo :{ + title: 'react by example', + author : 'vipul sonpatki', + language : 'english', + }}, + {bookInfo :{ + title: 'moral sentiments', + author : 'adam smith', + language : 'english', + }} + ] + +// adding "itemClick" event +let temp = []; +let itemClick = (e) => { + let id = e.target.id; + if(temp.indexOf(id) == -1){ + temp.push(id); + + let title = books[id]['bookInfo']['title']; + let author = books[id]['bookInfo']['author']; + let language = books[id]['bookInfo']['language']; - // Replace with your own code - console.log(bookTitles); + let str = '
'; + str += '

' + title + '

'; + str += ''; + str += '

author: ' + author + '

'; + str += '

language: ' + language + '

'; + document.getElementById('pagecontent').innerHTML += str; + } } +// getting list book's id +bookTitles.forEach(function (bookTitle, i) { + + let li = document.createElement('p'); + li.setAttribute('id', i); + li.classList.add('book'); + li.innerHTML = bookTitle; + li.addEventListener('click', itemClick); + + document.getElementById('bookcontainer').appendChild(li); + + }); +// obj with nested props +function myFunction() { + document.getElementById('bookcontainer').height="400" + +} + + + diff --git a/Week1/homework/index.html b/Week1/homework/index.html index b22147cd1..ddb084f8d 100644 --- a/Week1/homework/index.html +++ b/Week1/homework/index.html @@ -1 +1,29 @@ - \ No newline at end of file + + + + + + BookTitle + + + + + + +
+

Click to see the list of books I have read!

+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/Week1/homework/pictures/Apostolic Breakthrough.jpg b/Week1/homework/pictures/Apostolic Breakthrough.jpg new file mode 100644 index 000000000..a5304db50 Binary files /dev/null and b/Week1/homework/pictures/Apostolic Breakthrough.jpg differ diff --git a/Week1/homework/pictures/Business Relationships.jpg b/Week1/homework/pictures/Business Relationships.jpg new file mode 100644 index 000000000..18ff47586 Binary files /dev/null and b/Week1/homework/pictures/Business Relationships.jpg differ diff --git a/Week1/homework/pictures/Full-Stack React.jpg b/Week1/homework/pictures/Full-Stack React.jpg new file mode 100644 index 000000000..643bc1a86 Binary files /dev/null and b/Week1/homework/pictures/Full-Stack React.jpg differ diff --git a/Week1/homework/pictures/Happy Partner.jpg b/Week1/homework/pictures/Happy Partner.jpg new file mode 100644 index 000000000..971fda0c1 Binary files /dev/null and b/Week1/homework/pictures/Happy Partner.jpg differ diff --git a/Week1/homework/pictures/Karl Marx.jpg b/Week1/homework/pictures/Karl Marx.jpg new file mode 100644 index 000000000..89dfba38b Binary files /dev/null and b/Week1/homework/pictures/Karl Marx.jpg differ diff --git a/Week1/homework/pictures/ReactJS by Eaample.jpg b/Week1/homework/pictures/ReactJS by Eaample.jpg new file mode 100644 index 000000000..56aea7d00 Binary files /dev/null and b/Week1/homework/pictures/ReactJS by Eaample.jpg differ diff --git a/Week1/homework/pictures/The Theory of Moral Sentiments.jpg b/Week1/homework/pictures/The Theory of Moral Sentiments.jpg new file mode 100644 index 000000000..69c8933ce Binary files /dev/null and b/Week1/homework/pictures/The Theory of Moral Sentiments.jpg differ diff --git a/Week1/homework/pictures/The health of Nations.jpg b/Week1/homework/pictures/The health of Nations.jpg new file mode 100644 index 000000000..9da571c4e Binary files /dev/null and b/Week1/homework/pictures/The health of Nations.jpg differ diff --git a/Week1/homework/pictures/Web Developemt with MongoDB and Node.js.jpg b/Week1/homework/pictures/Web Developemt with MongoDB and Node.js.jpg new file mode 100644 index 000000000..7292d71ec Binary files /dev/null and b/Week1/homework/pictures/Web Developemt with MongoDB and Node.js.jpg differ diff --git a/Week1/homework/pictures/capital.jpg b/Week1/homework/pictures/capital.jpg new file mode 100644 index 000000000..89dfba38b Binary files /dev/null and b/Week1/homework/pictures/capital.jpg differ diff --git a/Week1/homework/pictures/cart to business relationship.jpg b/Week1/homework/pictures/cart to business relationship.jpg new file mode 100644 index 000000000..18ff47586 Binary files /dev/null and b/Week1/homework/pictures/cart to business relationship.jpg differ diff --git a/Week1/homework/pictures/chamber of secretes.jpg b/Week1/homework/pictures/chamber of secretes.jpg new file mode 100644 index 000000000..971fda0c1 Binary files /dev/null and b/Week1/homework/pictures/chamber of secretes.jpg differ diff --git a/Week1/homework/pictures/front end handbook.jpg b/Week1/homework/pictures/front end handbook.jpg new file mode 100644 index 000000000..1fa044f8f Binary files /dev/null and b/Week1/homework/pictures/front end handbook.jpg differ diff --git a/Week1/homework/pictures/front_end_handbook.jpg b/Week1/homework/pictures/front_end_handbook.jpg new file mode 100644 index 000000000..1fa044f8f Binary files /dev/null and b/Week1/homework/pictures/front_end_handbook.jpg differ diff --git a/Week1/homework/pictures/full stack react project.jpg b/Week1/homework/pictures/full stack react project.jpg new file mode 100644 index 000000000..643bc1a86 Binary files /dev/null and b/Week1/homework/pictures/full stack react project.jpg differ diff --git a/Week1/homework/pictures/moral sentiments.jpg b/Week1/homework/pictures/moral sentiments.jpg new file mode 100644 index 000000000..69c8933ce Binary files /dev/null and b/Week1/homework/pictures/moral sentiments.jpg differ diff --git a/Week1/homework/pictures/react by example.jpg b/Week1/homework/pictures/react by example.jpg new file mode 100644 index 000000000..56aea7d00 Binary files /dev/null and b/Week1/homework/pictures/react by example.jpg differ diff --git a/Week1/homework/pictures/wealth of nations.jpg b/Week1/homework/pictures/wealth of nations.jpg new file mode 100644 index 000000000..9da571c4e Binary files /dev/null and b/Week1/homework/pictures/wealth of nations.jpg differ diff --git a/Week1/homework/pictures/web development.jpg b/Week1/homework/pictures/web development.jpg new file mode 100644 index 000000000..7292d71ec Binary files /dev/null and b/Week1/homework/pictures/web development.jpg differ diff --git a/Week1/homework/pictures/web_dev_mongodb_nodejs.bmp b/Week1/homework/pictures/web_dev_mongodb_nodejs.bmp new file mode 100644 index 000000000..d7a31e199 Binary files /dev/null and b/Week1/homework/pictures/web_dev_mongodb_nodejs.bmp differ diff --git a/Week1/homework/style.css b/Week1/homework/style.css index bab13ec23..9ab174bf2 100644 --- a/Week1/homework/style.css +++ b/Week1/homework/style.css @@ -1 +1,73 @@ -/* add your styling here */ \ No newline at end of file +body{ + + font-family: Arial, Helvetica, sans-serif; + font-size:17px; + line-height:1.6; + background-color: darkgreen; +} +.pagecontainer { + width:70%; + margin:0 auto; +} +ul { + list-style:none; +} +h1{ + color: blue; +} +#bookcontainer { + margin-bottom:30px; +} +#pagecontent { + margin-top:10px; +} +.card { + width:200px; + height:250px; + background:silver; + text-align:center; + display:inline-block; + cursor:pointer; + margin:10px; +} +.card:hover { + box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); + -ms-transform: scale(2.0); /* IE 9 */ + -webkit-transform: scale(2.0); /* Safari 3-8 */ + transform: scale(2.0); + transition: all 1.2s ease-in-out; + +} +.card > img { + width:100px; + height:120px; + margin:0 auto; +} +.card > p:nth-child(1) { + font-weight:bold; + margin-bottom:5px; + color:red; + font-size:14px; +} + +/*add the style for image, title, author, language */ +.book { + color : red; + cursor:pointer; +} +.book:hover { + color:green; +} +p { + margin:0; +} +.card_t { + width:500px; + height:270px; + background:silver; + text-align:center; + display:inline-block; + cursor:pointer; + margin:10px; + box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); +} \ No newline at end of file diff --git a/Week2/homework/maartjes_work.js b/Week2/homework/maartjes_work.js index 0b451d122..6cbf5ec5a 100644 --- a/Week2/homework/maartjes_work.js +++ b/Week2/homework/maartjes_work.js @@ -1,3 +1,6 @@ +//2.1 + +//2.2 'use strict'; const monday = [ @@ -45,3 +48,22 @@ const tuesday = [ const tasks = monday.concat(tuesday); // Add your code here +//console.log(tasks); + +<<<<<<< HEAD +// convert Maarje working mins into hours then into salary for Mon-Tuesday +======= +// convert Maarje's working mins into hours then into salary for Mon-Tuesday +>>>>>>> f6d1acc7b0ab9c3a3f3c27687df766257317bf60 +const salary = tasks.map(lengths => { return lengths.duration }) + .map(hours => hours / 60) + .filter(long => long >= 2) + .map(rate => rate * 25) + .map(euro => { return euro.toFixed(2) }) + .reduce((accumulator, wage) => { return accumulator + wage; 0 }); + +<<<<<<< HEAD +console.log('Maartje\'s salary for Monday and Tuesday is ' + '€' + salary); +======= +console.log('Maartje\'s salary for Monday and Tuesday is ' + '€' + salary); +>>>>>>> f6d1acc7b0ab9c3a3f3c27687df766257317bf60 diff --git a/Week2/homework/map_filter.js b/Week2/homework/map_filter.js index b6af22631..198d6b198 100644 --- a/Week2/homework/map_filter.js +++ b/Week2/homework/map_filter.js @@ -3,3 +3,12 @@ const numbers = [1, 2, 3, 4]; // Add your code here +const oddNumbers = numbers.filter(x => x % 2 !== 0); +const doubleNumbers = oddNumbers.map(x => { if (x % 2 !== 0) return x * 2 }); + +console.log(oddNumbers); //==>[1, 3] +<<<<<<< HEAD +console.log(doubleNumbers);//==> [2,6] +======= +console.log(doubleNumbers);//==> [2,6] +>>>>>>> f6d1acc7b0ab9c3a3f3c27687df766257317bf60 diff --git a/Week3/homework/1-step3.js b/Week3/homework/1-step3.js index bee3be0a0..9c07d45af 100644 --- a/Week3/homework/1-step3.js +++ b/Week3/homework/1-step3.js @@ -1,7 +1,7 @@ 'use strict'; function foo(func) { - // What to do here? + return func; } function bar() { diff --git a/Week3/homework/2-step3.js b/Week3/homework/2-step3.js index 777ca2038..32e52ecfe 100644 --- a/Week3/homework/2-step3.js +++ b/Week3/homework/2-step3.js @@ -1,8 +1,10 @@ 'use strict'; function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) { - const values = []; - // Add your code here + let values = []; + for (var i = startIndex; i <= stopIndex; i++){ + values.push(i); + } } threeFive(10, 15, sayThree, sayFive); diff --git a/Week3/homework/3-step3.js b/Week3/homework/3-step3.js index 75200818b..ed5fbc400 100644 --- a/Week3/homework/3-step3.js +++ b/Week3/homework/3-step3.js @@ -1,25 +1,52 @@ 'use strict'; -// use a 'for' loop +// a 'for' loop function repeatStringNumTimesWithFor(str, num) { - // add your code here + let x = ''; + if (num < 0) { + return x; + } + else { + for (let i = 0; i < num; i++) { + x += str + } + } + str = x return str; } + + + console.log('for', repeatStringNumTimesWithFor('abc', 3)); // use a 'while' loop function repeatStringNumTimesWithWhile(str, num) { - // add your code here + let x = ''; + while (num > 0) { + x += str; + num--; + } + str = x return str; } console.log('while', repeatStringNumTimesWithWhile('abc', 3)); -// use a 'do...while' loop +// 'do...while' loop function repeatStringNumTimesWithDoWhile(str, num) { - // add your code here + let x = ''; + do { + if (num < 0) { + return x; + } + x += str; + num--; + + } while (num > 0); + + str = x; return str; } -console.log('while', repeatStringNumTimesWithDoWhile('abc', 3)); +console.log('do...while', repeatStringNumTimesWithDoWhile('abc', 3)); \ No newline at end of file diff --git a/Week3/homework/4-step3.js b/Week3/homework/4-step3.js index 52a0e9d74..695ba03a9 100644 --- a/Week3/homework/4-step3.js +++ b/Week3/homework/4-step3.js @@ -1,2 +1,17 @@ 'use strict'; // paste your freeCodeCamp solutions in here +function Dog (){ +this.name = "Bigo"; +this.color = "black"; +this.numLegs = 4; +} + + + +function Dog() { + this.name = "Rupert"; + this.color = "brown"; + this.numLegs = 4; +} +// Add your code below this line +let hound = new Dog(); \ No newline at end of file diff --git a/Week3/homework/5-step3.js b/Week3/homework/5-step3.js index 52a0e9d74..4c662a1e0 100644 --- a/Week3/homework/5-step3.js +++ b/Week3/homework/5-step3.js @@ -1,2 +1,16 @@ 'use strict'; // paste your freeCodeCamp solutions in here +function multiplyAll(arr) { + var product = 1; + // Only change code below this line + for(var i=0; i < arr.length; i++){ + for (var j=0; j < arr[i].length; j++){ + product = product * arr[i][j]; + } + } + // Only change code above this line + return product; +} + +// Modify values below to test your code +multiplyAll([[1,2],[3,4],[5,6,7]]); \ No newline at end of file diff --git a/Week3/homework/6-step3.js b/Week3/homework/6-step3.js index 89076b078..fe53be413 100644 --- a/Week3/homework/6-step3.js +++ b/Week3/homework/6-step3.js @@ -4,3 +4,13 @@ const arr2d = [[1, 2], [3, 4], [5, 6]]; const arr3d = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]; // add your solution here, or add a comment on how you would tackle this problem + + +for (let i = 0; i < arr3d.length; i++) { + for (let j = 0; j < arr3d[i].length; j++) { + console.log(arr3d[i][j]); + } +} +/* the problem can be solve using for loop using i & j +each of the arr will have its own for loop +then reurn both with a console.log*/ diff --git a/Week3/homework/7-step3.js b/Week3/homework/7-step3.js index af1712faf..f1fee7774 100644 --- a/Week3/homework/7-step3.js +++ b/Week3/homework/7-step3.js @@ -21,5 +21,5 @@ f2(y); console.log(y); -// Add your explanation as a comment here +// the f1 call that variable x which 9 & f2 retrieve f1 and add 1 to it to make it 10. diff --git a/Week3/homework/step4-bonus.js b/Week3/homework/step4-bonus.js index 4e89b29e7..3bc72cd15 100644 --- a/Week3/homework/step4-bonus.js +++ b/Week3/homework/step4-bonus.js @@ -1,10 +1,51 @@ 'use strict'; -const values = ['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']; +// Add your code here +// numberValues stringValues +const stringValues = ['a', 'b', 'a', 'c','a', 'd', 'a','e','e', 'f', 'c' , 'f' , 'f' ]; -// Add your function here. Try and come up with a good name for this function +const numberValues = [1 , 2, 3, 4, 1, 6, 5 ,4,7, 7, 0 , 6 ,6 , 6 , 6 , 6]; -// Replace `yourFunction` with the name of the function you just created -const uniqueValues = yourFunction(values); +function sortUniquerNumberArryAndStringArry( arr ) { -console.log(uniqueValues); + if ( typeof arr[0] == "string" ) { + arr.sort(); + } + + else if ( typeof arr[0] == "number" ) { + arr.sort(function(a, b){return a - b}); + } + + else { + return console.error('The array is neither a "string" or a "number" '); + } + + + + for ( var i = 0 ; i < arr.length -1 ; i ++) { + + if ( typeof arr[ i ] === typeof arr[ i + 1] ){ + + if ( arr[ i ] === arr[ i + 1] ){ + + arr.splice(i, 1); + + sortUniquerNumberArryAndStringArry( arr ); + + } + } + else{ + return ; + } + + } + return arr; +} + + +const uniqueStringValues = sortUniquerNumberArryAndStringArry( stringValues ); +console.log(uniqueStringValues); + + +const uniqueNumberValues = sortUniquerNumberArryAndStringArry( numberValues ); +console.log(uniqueNumberValues); \ No newline at end of file diff --git a/Week3/homework/step4.js b/Week3/homework/step4.js index e38d43447..a419cdf29 100644 --- a/Week3/homework/step4.js +++ b/Week3/homework/step4.js @@ -1,8 +1,14 @@ + 'use strict'; -// Add your code here +function createBase(number1) { + return function (number2) { + return number1 + number2; + }; +} const addSix = createBase(6); -addSix(10); // returns 16 -addSix(21); // returns 27 +console.log(addSix(10)); // it will returns 16 +console.log(addSix(21)); // it will returns 27 +console.log(addSix(30)); // it will returns 36 \ No newline at end of file