You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/66643c93e05093c728abdbe9.md
+26-3Lines changed: 26 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,19 @@ Before moving on, take a moment to review how functions work.
11
11
12
12
Declare a function named `addTwoNumbers`. This function should take two arguments and return the sum of those two arguments.
13
13
14
-
Then declare a `sum` variable and assign it the value of calling your `addTwoNumbers`function with `5` and `10` as the arguments. Log the `sum` variable to the console.
14
+
Your function should not use hard-coded values. An example of a hard-coded function might be:
15
15
16
+
```js
17
+
functionsayName(firstName, lastName) {
18
+
return"John Doe";
19
+
}
20
+
21
+
sayName("Camper", "Cat");
22
+
```
23
+
24
+
This function would return `"John Doe"` regardless of the arguments passed to the parameters `firstName`, and `lastName`, so `"John Doe"` is considered a hard-coded value.
25
+
26
+
Declare a `sum` variable and assign it the value of calling your `addTwoNumbers` function with `5` and `10` as the arguments. Log the `sum` variable to the console.
0 commit comments