From 2991b0c779cee73c5c48d61e3a8ac4d082e819b4 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:15:08 -0600 Subject: [PATCH 01/16] complete Request 1 --- README.md | 32 +++++++++++++++++++++++--------- challenges/arrays-callbacks.js | 9 +++++---- challenges/index.html | 6 +++--- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index cc6d6902fb..e08d829dc7 100644 --- a/README.md +++ b/README.md @@ -26,27 +26,41 @@ Edit this document to include your answers after each question. Make sure to lea 1. Briefly compare and contrast `.forEach` & `.map` (2-3 sentences max) +forEach and map both access every element in an array. map returns a new array that contains whatever you return. forEach does not return an array and can be used to modify the original array. + 2. Explain the difference between a callback and a higher order function. +A higher order function is a function that takes another function as an argument. A callback is a function that is passed into a higher order function. + 3. What is closure? +A closure is a function that is enclosed with references to its state. This allows for a state to persist between runs of a function. + 4. Describe the four rules of the 'this' keyword. +1. this in the global scope refers to the window/console object +2. When a preceding dot calls a function, the object before the dot is this +3. When a constructor function is used, this refers to the specific instance of the object that is created and returned +4. When call or apply is used, then this is explicitly defined + + 5. Why do we need super() in an extended class? +super allows us to pass the variables to the parent class, since we are using a child or extended class. + ### Task 1 - Project Set up Follow these steps to set up and work on your project: Make sure you clone the branch that the TK links to: the vnext branch, NOT master! -- [ ] Create a forked copy of this project. -- [ ] Add TL as collaborator on Github. -- [ ] Clone your OWN version of Repo (Not Lambda's by mistake!). -- [ ] Create a new Branch on the clone: git checkout -b ``. -- [ ] Create a pull request before you start working on the project requirements. You will continuously push your updates throughout the project. -- [ ] You are now ready to build this project with your preferred IDE -- [ ] Implement the project on your Branch, committing changes regularly. -- [ ] Push commits: git push origin ``. +- [x] Create a forked copy of this project. +- [x] Add TL as collaborator on Github. +- [x] Clone your OWN version of Repo (Not Lambda's by mistake!). +- [x] Create a new Branch on the clone: git checkout -b ``. +- [x] Create a pull request before you start working on the project requirements. You will continuously push your updates throughout the project. +- [x] You are now ready to build this project with your preferred IDE +- [x] Implement the project on your Branch, committing changes regularly. +- [x] Push commits: git push origin ``. @@ -63,7 +77,7 @@ Test your knowledge of advanced array methods and callbacks. #### Task B: Closure -This challenge takes a look at closures as well as scope. +This challenge takes a look at closures as well as scope. * [ ] Use the [closure.js](challenges/closure.js) link to get started. Read the instructions carefully! #### Task C: Prototypes diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index 472ab3e96d..a375a82b07 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -21,6 +21,7 @@ The zoos want to display both the scientific name and the animal name in front o */ const displayNames = []; +zooAnimals.forEach(animal => displayNames.push(`Name: ${animal.animal_name}, Scientific: ${animal.scientific_name}`)); console.log(displayNames); /* Request 2: .map() @@ -32,7 +33,7 @@ The zoos need a list of all their animal's names (animal_name only) converted to const lowCaseAnimalNames = []; console.log(lowCaseAnimalNames); -/* Request 3: .filter() +/* Request 3: .filter() The zoos are concerned about animals with a lower population count. Using filter, create a new array of objects called lowPopulationAnimals which contains only the animals with a population less than 5. @@ -40,7 +41,7 @@ The zoos are concerned about animals with a lower population count. Using filter const lowPopulationAnimals = []; console.log(lowPopulationAnimals); -/* Request 4: .reduce() +/* Request 4: .reduce() The zoos need to know their total animal population across the United States. Find the total population from all the zoos using the .reduce() method. Remember the reduce method takes two arguments: a callback (which itself takes two args), and an initial value for the count. @@ -49,7 +50,7 @@ const populationTotal = 0; console.log(populationTotal); -// ==== Callbacks ==== +// ==== Callbacks ==== /* Step 1: Create a higher-order function * Create a higher-order function named consume with 3 parameters: a, b and cb @@ -61,7 +62,7 @@ console.log(populationTotal); /* Step 2: Create several functions to callback with consume(); * Create a function named add that returns the sum of two numbers - * Create a function named multiply that returns the product of two numbers + * Create a function named multiply that returns the product of two numbers * Create a function named greeting that accepts a first and last name and returns "Hello first-name last-name, nice to meet you!" */ diff --git a/challenges/index.html b/challenges/index.html index 5772804b7f..7d278ef1bd 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -7,10 +7,10 @@ Sprint Challenge - - + + From b040fbdcfc8e581fee05d03d4ab6eed279e4d186 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:18:02 -0600 Subject: [PATCH 02/16] complete Request 2 and 3 --- challenges/arrays-callbacks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index a375a82b07..62583d9a7a 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -30,7 +30,7 @@ The zoos need a list of all their animal's names (animal_name only) converted to */ -const lowCaseAnimalNames = []; +const lowCaseAnimalNames = zooAnimals.map(animal => animal.animal_name.toLowerCase()); console.log(lowCaseAnimalNames); /* Request 3: .filter() @@ -38,7 +38,7 @@ console.log(lowCaseAnimalNames); The zoos are concerned about animals with a lower population count. Using filter, create a new array of objects called lowPopulationAnimals which contains only the animals with a population less than 5. */ -const lowPopulationAnimals = []; +const lowPopulationAnimals = zooAnimals.filter(animal => animal.population < 5); console.log(lowPopulationAnimals); /* Request 4: .reduce() From 3e4826eaaf97bf2e07cf405f02f4d0b9b787f2a0 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:22:45 -0600 Subject: [PATCH 03/16] complete Request 4 --- challenges/arrays-callbacks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index 62583d9a7a..cd9c90c09b 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -46,7 +46,7 @@ console.log(lowPopulationAnimals); The zoos need to know their total animal population across the United States. Find the total population from all the zoos using the .reduce() method. Remember the reduce method takes two arguments: a callback (which itself takes two args), and an initial value for the count. */ -const populationTotal = 0; +const populationTotal = zooAnimals.reduce((animalAccumulator, animal) => animalAccumulator + animal.population, 0); console.log(populationTotal); From 86c20e945f6b2539fed962eae26c70d65311f246 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:23:48 -0600 Subject: [PATCH 04/16] complete consume function --- challenges/arrays-callbacks.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index cd9c90c09b..1b3bac9486 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -59,6 +59,9 @@ console.log(populationTotal); * The consume function should return the invocation of cb, passing a and b into cb as arguments */ +function consume(a, b, cb) { + return cb(a, b); +} /* Step 2: Create several functions to callback with consume(); * Create a function named add that returns the sum of two numbers From d60b2ae2b64cbcb1b6ed1896762a050716d5c74d Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:25:51 -0600 Subject: [PATCH 05/16] complete add, multiply, and greeting functions --- challenges/arrays-callbacks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index 1b3bac9486..2f08052ce2 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -68,7 +68,9 @@ function consume(a, b, cb) { * Create a function named multiply that returns the product of two numbers * Create a function named greeting that accepts a first and last name and returns "Hello first-name last-name, nice to meet you!" */ - +function add(a, b) { + return a + b; +} /* Step 3: Check your work by un-commenting the following calls to consume(): */ // console.log(consume(2, 2, add)); // 4 From e3106bf75c862ac53686cb4488732ee69d142d32 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:26:31 -0600 Subject: [PATCH 06/16] test the consume functions --- challenges/arrays-callbacks.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/challenges/arrays-callbacks.js b/challenges/arrays-callbacks.js index 2f08052ce2..c8b87d0c86 100644 --- a/challenges/arrays-callbacks.js +++ b/challenges/arrays-callbacks.js @@ -72,10 +72,18 @@ function add(a, b) { return a + b; } +function multiply(a, b) { + return a * b; +} + +function greeting(firstName, lastName) { + return `Hello ${firstName} ${lastName}, nice to meet you!`; +} + /* Step 3: Check your work by un-commenting the following calls to consume(): */ -// console.log(consume(2, 2, add)); // 4 -// console.log(consume(10, 16, multiply)); // 160 -// console.log(consume("Mary", "Poppins", greeting)); // Hello Mary Poppins, nice to meet you! +console.log(consume(2, 2, add)); // 4 +console.log(consume(10, 16, multiply)); // 160 +console.log(consume("Mary", "Poppins", greeting)); // Hello Mary Poppins, nice to meet you! From b687d2bcb2cf93df08c2acb02babac67da2420ae Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:30:26 -0600 Subject: [PATCH 07/16] complete explanation of scope --- README.md | 2 +- challenges/closure.js | 6 ++++-- challenges/index.html | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e08d829dc7..afd5eb56ab 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Your finished project must include all of the following requirements: #### Task A: Objects and Arrays Test your knowledge of advanced array methods and callbacks. -* [ ] Use the [arrays-callbacks.js](challenges/arrays-callbacks.js) link to get started. Read the instructions carefully! +* [x] Use the [arrays-callbacks.js](challenges/arrays-callbacks.js) link to get started. Read the instructions carefully! #### Task B: Closure diff --git a/challenges/closure.js b/challenges/closure.js index 101d68e553..a1f934d4c1 100644 --- a/challenges/closure.js +++ b/challenges/closure.js @@ -1,4 +1,4 @@ -// ==== Closures ==== +// ==== Closures ==== /* Task 1: Study the code below and explain in your own words why nested function can access the variable internal. */ @@ -16,9 +16,11 @@ function myFunction() { } myFunction(); -// Explanation: +// Explanation: +// The variable internal is in the same lexical scope as nestedFunction. nestedFunction has access to all the variables that are within the global scope and the myFunction scope. /* Task 2: Counter */ /* Create a function called `sumation` that accepts a parameter and uses a counter to return the summation of that number. For example, `summation(4)` should return 10 because 1+2+3+4 is 10. */ + diff --git a/challenges/index.html b/challenges/index.html index 7d278ef1bd..78dc5e50f2 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -7,9 +7,9 @@ Sprint Challenge - - + + From 264b29bc920169ee62d9f42cdaeb0c1ab03cefd6 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:37:27 -0600 Subject: [PATCH 08/16] complete counter function --- challenges/closure.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/challenges/closure.js b/challenges/closure.js index a1f934d4c1..1d14a34d4f 100644 --- a/challenges/closure.js +++ b/challenges/closure.js @@ -24,3 +24,14 @@ myFunction(); /* Create a function called `sumation` that accepts a parameter and uses a counter to return the summation of that number. For example, `summation(4)` should return 10 because 1+2+3+4 is 10. */ +function summation(number) { + let count = 0; + + for(let i=1; i<=number; i++) { + count += i; + } + + return count; +} + +console.log(summation(4)); \ No newline at end of file From e60a77996f7ebf222890b80821d5a9ba2c526ce7 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:40:03 -0600 Subject: [PATCH 09/16] create CuboidMaker constructor --- README.md | 2 +- challenges/index.html | 6 +++--- challenges/prototypes.js | 11 ++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index afd5eb56ab..daca04051d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Test your knowledge of advanced array methods and callbacks. #### Task B: Closure This challenge takes a look at closures as well as scope. -* [ ] Use the [closure.js](challenges/closure.js) link to get started. Read the instructions carefully! +* [x] Use the [closure.js](challenges/closure.js) link to get started. Read the instructions carefully! #### Task C: Prototypes diff --git a/challenges/index.html b/challenges/index.html index 78dc5e50f2..f50f6cec9f 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -8,9 +8,9 @@ Sprint Challenge - - + + + diff --git a/challenges/prototypes.js b/challenges/prototypes.js index 4cafc33e95..8eea710fdc 100644 --- a/challenges/prototypes.js +++ b/challenges/prototypes.js @@ -6,16 +6,21 @@ Create a constructor function named CuboidMaker that accepts properties for length, width, and height */ +function CuboidMaker(length, width, height) { + this.length = length; + this.width = width; + this.height = height; +} /* == Step 2: Volume Method == Create a method using CuboidMaker's prototype that returns the volume of a given cuboid's length, width, and height - + Formula for cuboid volume: length * width * height */ /* == Step 3: Surface Area Method == - Create another method using CuboidMaker's prototype that returns the surface area of a given cuboid's length, width, and height. + Create another method using CuboidMaker's prototype that returns the surface area of a given cuboid's length, width, and height. Formula for cuboid surface area of a cube: 2 * (length * width + length * height + width * height) */ @@ -23,7 +28,7 @@ /* == Step 4: Create a new object that uses CuboidMaker == Create a cuboid object that uses the new keyword to use our CuboidMaker constructor - Add properties and values of length: 4, width: 5, and height: 5 to cuboid. + Add properties and values of length: 4, width: 5, and height: 5 to cuboid. */ // Test your volume and surfaceArea methods by uncommenting the logs below: From c5001528176f9009dd22ffd14820a960a7b430f5 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:42:47 -0600 Subject: [PATCH 10/16] add volume to CuboidMaker prototype --- challenges/prototypes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/challenges/prototypes.js b/challenges/prototypes.js index 8eea710fdc..02360b1e18 100644 --- a/challenges/prototypes.js +++ b/challenges/prototypes.js @@ -17,6 +17,9 @@ function CuboidMaker(length, width, height) { Formula for cuboid volume: length * width * height */ +CuboidMaker.prototype.volume = function() { + return this.length * this.width * this.height; +}; /* == Step 3: Surface Area Method == From 3d0a501234f2f447f856eb16eb7d2134b7df0622 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:44:43 -0600 Subject: [PATCH 11/16] add surfaceArea to CuboidMaker protoype --- challenges/prototypes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/challenges/prototypes.js b/challenges/prototypes.js index 02360b1e18..27c96336a5 100644 --- a/challenges/prototypes.js +++ b/challenges/prototypes.js @@ -27,6 +27,9 @@ CuboidMaker.prototype.volume = function() { Formula for cuboid surface area of a cube: 2 * (length * width + length * height + width * height) */ +CuboidMaker.prototype.surfaceArea = function() { + return 2 * ((this.length * this.width) + (this.length * this.height) + (this.width * this.height)); +}; /* == Step 4: Create a new object that uses CuboidMaker == From 082a730f23ce0f8476f0a9f3c25c79b6e7a86e8d Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:46:05 -0600 Subject: [PATCH 12/16] create cuboid and pass tests --- challenges/prototypes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/challenges/prototypes.js b/challenges/prototypes.js index 27c96336a5..cdeec32f30 100644 --- a/challenges/prototypes.js +++ b/challenges/prototypes.js @@ -37,8 +37,10 @@ CuboidMaker.prototype.surfaceArea = function() { Add properties and values of length: 4, width: 5, and height: 5 to cuboid. */ +const cuboid = new CuboidMaker(4, 5, 5); + // Test your volume and surfaceArea methods by uncommenting the logs below: -// console.log(cuboid.volume()); // 100 -// console.log(cuboid.surfaceArea()); // 130 +console.log(cuboid.volume()); // 100 +console.log(cuboid.surfaceArea()); // 130 From c9d51f0d0fbd340455a4a12f072775ccf5eccd31 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:50:31 -0600 Subject: [PATCH 13/16] refactor CuboidMaker into class syntax --- README.md | 2 +- challenges/classes.js | 25 +++++++++++++++++++++++-- challenges/index.html | 4 ++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index daca04051d..820e698d30 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ This challenge takes a look at closures as well as scope. #### Task C: Prototypes Create constructors, bind methods, and create cuboids in this prototypes challenge. -* [ ] Use the [prototypes.js](challenges/prototypes.js) link to get started. Read the instructions carefully! +* [x] Use the [prototypes.js](challenges/prototypes.js) link to get started. Read the instructions carefully! #### Task D: Classes diff --git a/challenges/classes.js b/challenges/classes.js index 992e39dc0b..6845836460 100644 --- a/challenges/classes.js +++ b/challenges/classes.js @@ -1,7 +1,28 @@ // 1. Copy and paste your prototype in here and refactor into class syntax. +class CuboidMaker { + constructor(length, width, height) { + this.length = length; + this.width = width; + this.height = height; + } + + volume() { + return this.length * this.width * this.height; + } + + surfaceArea() { + return 2 * ((this.length * this.width) + (this.length * this.height) + (this.width * this.height)); + } +} + + + +const cuboid = new CuboidMaker(4, 5, 5); + + // Test your volume and surfaceArea methods by uncommenting the logs below: -// console.log(cuboid.volume()); // 100 -// console.log(cuboid.surfaceArea()); // 130 +console.log(cuboid.volume()); // 100 +console.log(cuboid.surfaceArea()); // 130 // Stretch Task: Extend the base class CuboidMaker with a sub class called CubeMaker. Find out the formulas for volume and surface area for cubes and create those methods using the dimension properties from CuboidMaker. Test your work by logging out your volume and surface area. \ No newline at end of file diff --git a/challenges/index.html b/challenges/index.html index f50f6cec9f..100d33500f 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -9,8 +9,8 @@ - - + + From da2e6ba0b492ac5239a32818d3314b965e4f99f4 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:56:19 -0600 Subject: [PATCH 14/16] extend CuboidMaker with CubeMaker and test --- challenges/classes.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/challenges/classes.js b/challenges/classes.js index 6845836460..f59ae532ac 100644 --- a/challenges/classes.js +++ b/challenges/classes.js @@ -25,4 +25,23 @@ const cuboid = new CuboidMaker(4, 5, 5); console.log(cuboid.volume()); // 100 console.log(cuboid.surfaceArea()); // 130 -// Stretch Task: Extend the base class CuboidMaker with a sub class called CubeMaker. Find out the formulas for volume and surface area for cubes and create those methods using the dimension properties from CuboidMaker. Test your work by logging out your volume and surface area. \ No newline at end of file +// Stretch Task: Extend the base class CuboidMaker with a sub class called CubeMaker. Find out the formulas for volume and surface area for cubes and create those methods using the dimension properties from CuboidMaker. Test your work by logging out your volume and surface area. + +class CubeMaker extends CuboidMaker { + constructor(length) { + super(length, length, length); + } + + volume() { + return Math.pow(this.length, 3); + } + + surfaceArea() { + return 6 * Math.pow(this.length, 2); + } +} + +const cube = new CubeMaker(2); + +console.log(cube.volume()); // 8 +console.log(cube.surfaceArea()); // 24 \ No newline at end of file From d71ea22b62bc5194ca8af2423c85f5d7e78999d7 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 17:57:38 -0600 Subject: [PATCH 15/16] final submission --- README.md | 8 ++++---- challenges/index.html | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 820e698d30..e15011636d 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Create constructors, bind methods, and create cuboids in this prototypes challen #### Task D: Classes Once you have completed the prototypes challenge, it's time to convert all your hard work into classes. -* [ ] Use the [classes.js](challenges/classes.js) link to get started. Read the instructions carefully! +* [x] Use the [classes.js](challenges/classes.js) link to get started. Read the instructions carefully! In your solutions, it is essential that you follow best practices and produce clean and professional results. Schedule time to review, refine, and assess your work and perform basic professional polishing including spell-checking and grammar-checking on your work. It is better to submit a challenge that meets MVP than one that attempts too much and does not. @@ -100,6 +100,6 @@ There are a few stretch problems found throughout the files, don't work on them Follow these steps for completing your project: -- [ ] Submit a Pull-Request to merge Branch into master (student's Repo). -- [ ] Add your team lead as a Reviewer on the Pull-request -- [ ] TL then will count the HW as done by merging the branch back into master. +- [x] Submit a Pull-Request to merge Branch into master (student's Repo). +- [x] Add your team lead as a Reviewer on the Pull-request +- [x] TL then will count the HW as done by merging the branch back into master. diff --git a/challenges/index.html b/challenges/index.html index 100d33500f..278e5bca05 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -7,9 +7,9 @@ Sprint Challenge - - - + --> + + From 0dfbaf4b63c7ea832df13bbdbabbf2b804e0fd7a Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Fri, 15 May 2020 18:02:53 -0600 Subject: [PATCH 16/16] fix stray text on index.html --- challenges/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/index.html b/challenges/index.html index 278e5bca05..0dc5ec27dd 100644 --- a/challenges/index.html +++ b/challenges/index.html @@ -7,7 +7,7 @@ Sprint Challenge - --> +