Skip to content
Prev Previous commit
Next Next commit
add pics
  • Loading branch information
Nouransaeed committed Aug 14, 2019
commit 40e4ccb60121721952ace62a98ed6467293b189b
27 changes: 26 additions & 1 deletion Week2/homework/map-filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
/*'use strict';

function doubleOddNumbers(numbers) {
// Replace this comment and the next line with your code
Expand All @@ -12,4 +12,29 @@ console.log(doubleOddNumbers(myNumbers));
module.exports = {
myNumbers,
doubleOddNumbers,
}; */

'use strict';

function doubleOddNumbers(numbers) {

numbers = numbers.filter(num => num % 2 === 1).map(num => num * 2);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! But there seems to be many blank lines above and below. Can you delete?


console.log(numbers);

return numbers;



const myNumbers = [1, 2, 3, 4];

console.log(doubleOddNumbers(myNumbers));
module.exports = {

myNumbers,

doubleOddNumbers,

};

//finished