fix: Restore missing emojis and fix broken links (#35703)
* fix: Restore missing emojis and fix broken links * fix: Remove emojis to conform with style guide * fix: Remove the last emoticons
This commit is contained in:
committed by
Randell Dawson
parent
7a37788ea1
commit
73277d8ba8
@ -4,10 +4,10 @@ title: Set Default Parameters for Your Functions
|
||||
## Set Default Parameters for Your Functions
|
||||
|
||||
|
||||
:triangular_flag_on_post: Remember to use Read-Search-Ask if you get stuck. Try to pair program :busts_in_silhouette: and write your own code :pencil:
|
||||
Remember to use Read-Search-Ask if you get stuck. Try to pair program and write your own code.
|
||||
|
||||
|
||||
### :checkered_flag: Problem Explanation:
|
||||
### Problem Explanation:
|
||||
```javascript
|
||||
const increment = (function() {
|
||||
"use strict";
|
||||
@ -21,24 +21,23 @@ console.log(increment(5)); // returns NaN
|
||||
|
||||
We'll be modifying the increment function so that the **number** parameter is incremented by 1 by default, by setting **value** to 1 if a value for **value** is not passed to the increment function.
|
||||
|
||||
### :speech_balloon: Hint: 1
|
||||
### Hint: 1
|
||||
|
||||
Let's identify where the parameter **value** is in JS function
|
||||
|
||||
try to solve the problem now
|
||||
|
||||
### :speech_balloon: Hint: 2
|
||||
### Hint: 2
|
||||
|
||||
Set **value** equal to something so that it is that value by default
|
||||
|
||||
try to solve the problem now
|
||||
|
||||
### Spoiler Alert!
|
||||

|
||||
|
||||
Solution ahead!
|
||||
|
||||
## :beginner: Basic Code Solution:
|
||||
## Basic Code Solution:
|
||||
```javascript
|
||||
const increment = (function() {
|
||||
"use strict";
|
||||
@ -49,18 +48,18 @@ const increment = (function() {
|
||||
console.log(increment(5, 2)); // returns 7
|
||||
console.log(increment(5)); // returns NaN
|
||||
```
|
||||
:rocket: [Run Code](https://repl.it/@RyanPisuena/PleasingFumblingThings)
|
||||
[Run Code](https://repl.it/@RyanPisuena/PleasingFumblingThings)
|
||||
|
||||
## Code Explanation
|
||||
### Code Explanation
|
||||
|
||||
* This section is pretty straightforward. Pass this section by setting the **value** parameter equal to 1. When the function comes across test cases where **value** has not been passed anything, then **value** will be assigned one by default.
|
||||
* This section is pretty straightforward. Pass this section by setting the **value** parameter equal to 1. When the function comes across test cases where **value** has not been passed anything, then **value** will be assigned one by default.
|
||||
|
||||
Relevant Links:
|
||||
Relevant Links:
|
||||
|
||||
[JavaScript default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters)
|
||||
|
||||
# :clipboard: NOTES FOR CONTRIBUTIONS:
|
||||
## NOTES FOR CONTRIBUTIONS:
|
||||
|
||||
* :warning: DO NOT add solutions that are similar to any existing solutions. If you think it is similar but better, then try to merge (or replace) the existing similar solution.
|
||||
* DO NOT add solutions that are similar to any existing solutions. If you think it is similar but better, then try to merge (or replace) the existing similar solution.
|
||||
* Add an explanation of your solution.
|
||||
* Categorize the solution in one of the following categories — Basic, Intermediate and Advanced. :traffic_light:
|
||||
* Categorize the solution in one of the following categories — Basic, Intermediate and Advanced.
|
||||
|
Reference in New Issue
Block a user