Skip to content

Commit

Permalink
added daily codewars challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
CoriRen committed Sep 4, 2024
1 parent b3eb572 commit 6c814e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion codewars.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,10 @@ let sumMix = (x) => x.map((num) => +num).reduce((sum,acc)=>sum+acc,0)


//Function 2 - squaring an argument
let square = (num)=>num**2
let square = (num)=>num**2

//Sum of positive
//Only add the positive numbers of an array together
function positiveSum2(arr) {
return arr.filter((num) => num > 0).reduce((sum, current)=> sum + current, 0)
}

0 comments on commit 6c814e9

Please sign in to comment.