Skip to content

Commit

Permalink
Update 2023-1-13-retos-programacion.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
TripleYei authored Oct 2, 2023
1 parent b29a739 commit d1bbef3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions _posts/2023-1-13-retos-programacion.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,33 @@ function sumPoints(w,d,l){
}
~~~~


Find the smallest

~~~~
function findTheSmallest(arr) {
let small = Math.min(...arr)
return small
}
~~~~

Remove First and Last

~~~~
function removeChars(str) {
return str.substring(1,str.length-1)
}
~~~~

Get the Average
~~~~
function getAverage(arr) {
let divided = arr.length
let sum = 0
for(let i = 0; i<arr.length; i++)
sum+=arr[i]
return sum/divided
}
~~~~

0 comments on commit d1bbef3

Please sign in to comment.