Skip to content

Instantly share code, notes, and snippets.

@stoneboyindc
Last active May 3, 2021 01:06
Show Gist options
  • Save stoneboyindc/07987ae72b49443a3250e1a1dcc348d0 to your computer and use it in GitHub Desktop.
Save stoneboyindc/07987ae72b49443a3250e1a1dcc348d0 to your computer and use it in GitHub Desktop.
const printNames = names=> {
names.forEach((names)=>
console.log(names));
}
const logTreeType=trees=>{
trees.forEach((tree)=>
console.log(tree.type));
}
const totalPoints = points=>{
let sum = 0
points.forEach((num)=> sum += num)
return sum
}
const buildSentence = words =>{
let sentence = ""
const func= (word)=> sentence += word + " "
words.forEach(func)
return sentence
}
const logPercentages =decimals=> {
return decimals.map((decimal) => {
return decimal * 100 + "%"
})
}
module.exports = {
printNames,
logTreeType,
totalPoints,
buildSentence,
logPercentages
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment