Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5362b48

Browse files
committed
update
1 parent ae2ccaf commit 5362b48

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Week2/homework/map_filter.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ const oddOnes = numbers.filter(i => i % 2 != 0)
1010

1111
//Double the odds and kick out the evens:
1212

13-
const oddDoubling = oddOnes.map(i => {
14-
if (i % 2 != 0) {return i * 2;}
15-
else {return i;}
16-
})
13+
const oddDoubling = oddOnes.map(i => i * 2)
1714

1815
console.log("Doubled lucky odds: " + oddDoubling + "\nUnlucky kicked evens: " +oddOnes);

0 commit comments

Comments
 (0)