Skip to content

Commit e4a704e

Browse files
authored
Update activity.md
1 parent 1826d76 commit e4a704e

File tree

1 file changed

+3
-5
lines changed
  • Lessons/09-Functional-ProgrammingPt.1/assignments

1 file changed

+3
-5
lines changed

Lessons/09-Functional-ProgrammingPt.1/assignments/activity.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ func doubleIt(inputArray: Array<Int>) {
1919
doubleIt(inputArray: [1,2,3]) // [2,4,6]
2020
```
2121

22-
**TODO:**
23-
2422
Code the declarative (FP) version of `doubleIt`so that it achieves the same result as the code above by using the `map` function instead of the `for loop`
2523

2624
<!--
@@ -38,11 +36,11 @@ doubleIt(inputArray: [1,2,3]) // [2,4,6]
3836

3937
2. Suppose we have an array containing strings representing the contents of a directory:
4038

41-
let exampleFiles = ["README.md", "HelloWorld.swift", "FlappyBird.swift"]
39+
`let exampleFiles = ["README.md", "HelloWorld.swift", "FlappyBird.swift"]`
4240

43-
Now suppose we want an array of all the .swift files. This is easy to compute with a simple loop. Use the HOF filter.
41+
Now suppose we want an array of all the .swift files. This is easy to compute with a simple loop. Use the HOF `filter`.
4442

45-
3. Define a function that sums all the integers in an array.
43+
3. Define a function that sums all the integers in an array. Use `reduce`
4644

4745
4. Suppose we have the following struct, consisting of a city’s name and population (measured in thousands of inhabitants):
4846

0 commit comments

Comments
 (0)