Skip to content

Instantly share code, notes, and snippets.

@stoneboyindc
Created March 4, 2021 22:33
Show Gist options
  • Save stoneboyindc/b618bd8680f0a422764a4449b727e2e2 to your computer and use it in GitHub Desktop.
Save stoneboyindc/b618bd8680f0a422764a4449b727e2e2 to your computer and use it in GitHub Desktop.
function printNames (names) {
names.forEach(name => console.log(name));
}
function logTreeType (trees) {
trees.forEach(type => console.log(type.type));
}
function totalPoints(points) {
// your solution here
let total = 0
points.forEach(score => {
total += score;
});
return total;
}
function buildSentence(words) {
let sentence = "";
words.forEach((word) => {
sentence += `${word} `;
});
return sentence;
}
function logPercentages(decimals) {
decimals.forEach((decimal) => {
console.log(`${decimal * 100}%`);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment