Skip to content

Commit ae7fb22

Browse files
authored
Merge pull request #2986 from ironhack-labs/uros/update/iteration-41-insructions
Update the iteration 4.1 instructions
2 parents 93c90e1 + 19f45b3 commit ae7fb22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ const words = ['seat', 'correspond', 'linen', 'motif', 'hole', 'smell', 'smart',
142142

143143
#### Bonus - Iteration #4.1: A generic `avg()` function
144144

145-
Create function `avg(arr)` that receives any mixed array and calculates average. Consider as mixed array an array filled with numbers and/or strings and/or booleans. We are following a similar logic to the one applied on the bonus iteration 4.1. :wink:
145+
Create function `avg(arr)` that receives any mixed array and calculates average. Consider as mixed array an array filled with numbers and/or strings and/or booleans.
146+
147+
The non-numerical values should be counted as follows:
148+
- Booleans: `true` counts as `1` and `false` counts as `0`.
149+
- Strings: use the string `length` as the numeric value.
150+
146151

147152
```javascript
148153
const mixedArr = [6, 12, 'miami', 1, true, 'barca', '200', 'lisboa', 8, 10];

0 commit comments

Comments
 (0)