Skip to content

Commit 79330b3

Browse files
committed
Wrap param in parens for Conjure
- Conjure evaluation breaks when single arrow function params not wrapped in parens. Wrapping in parens, fix config later...
1 parent ca210aa commit 79330b3

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

arrayConvert.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// Write a function, convertToBaby(), that takes in an array as an argument and, using a loop, returns a new array with each string in the array prepended with 'baby '.
22

3-
const convertToBaby = arr => {
4-
let babyArray = [];
5-
for (let i = 0; i < arr.length; i++) {
6-
babyArray.push(`baby ${arr[i]}`);
7-
}
8-
return babyArray;
3+
const convertToBaby = (arr) => {
4+
const babyArray = [];
5+
for (let i = 0; i < arr.length; i++) {
6+
babyArray.push(`baby ${arr[i]}`);
7+
}
8+
return babyArray;
99
}
1010

11-
// When you're ready to test your code, uncomment the below and run:
1211
const animals = ['panda', 'turtle', 'giraffe', 'hippo', 'sloth', 'human'];
1312

1413
console.log(convertToBaby(animals))
15-
// ['baby panda', 'baby turtle', 'baby giraffe', 'baby hippo', 'baby sloth', 'baby human']
14+
// ['baby panda', 'baby turtle', 'baby giraffe', 'baby hippo', 'baby sloth', 'baby human']

0 commit comments

Comments
 (0)