|
| 1 | +/** |
| 2 | + * Follow the comments below. |
| 3 | + * Feel free to use `console.log` to see what values are being returned. |
| 4 | +
|
| 5 | +// Create a variable called `myNumber`, and assign it to any number |
| 6 | +
|
| 7 | +/** |
| 8 | + * Create another variable called `stringValue`. |
| 9 | + * Assign it the value that's returned when you pass |
| 10 | + * `myNumber into the function `numberToString`. |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * If you pass `myNumber` and `stringValue` into `areEqual`, |
| 15 | + * what value will you get back? Why is that? |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * You may have noticed that the `calculate` function combined |
| 20 | + * the functionality of `add`, `subtract`, `multiply`, and `divide`. |
| 21 | + * Did you try to use those functions _inside_ of `calculate`? |
| 22 | + * If you didn't go back and try it, this is called "reusability"! |
| 23 | + */ |
| 24 | + |
| 25 | +// Do you see any other functions where code could be reused? |
| 26 | + |
| 27 | +/** |
| 28 | + * For your `letterGrade` function, |
| 29 | + * what happens if you provide a `score` that is less than 0, |
| 30 | + * or greater than the `total` value? |
| 31 | + * Does it still work as expected? If it doesn't, how could you improve this? |
| 32 | + */ |
| 33 | + |
| 34 | +/** |
| 35 | + * Your `combine` function looks okay, |
| 36 | + * but what if you wanted to join it with ANY string instead of a single space? |
| 37 | + * Create a new function called `improvedCombine`, |
| 38 | + * with the same parameters as `combine`, but also add a |
| 39 | + * third parameter called `glue` (a string value). |
| 40 | + */ |
| 41 | + |
| 42 | +// What happens if you were to uncomment the following lines? |
| 43 | + |
| 44 | +// combine = improvedCombine; |
| 45 | +// console.log(combine('combine', 'improved!', ' is ')); |
0 commit comments