@vkajdacsi/

IncompleteFrillyComputation

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function exerciseOne(names){
// Exercise One: In this exercise you will be given and array called names.
// Using the forEach method and a callback as it's only argument, console log 
// each of the names.
  console.log(names)
}
names.forEach(exerciseOne);

function exerciseTwo(cents){
// Exercise Two: In this exercise you will be given an array called 'cents'
// This array is a list of prices, but everything is in cents instead of dollars.
// Using the map method, divide every value by 100 and save it as a new array 'dollars'
let dollars = [];
for (let i = 0; i < cents.length; i++){
  let NewValues = (cents[i] / 100);
  dollars.push(NewValues);
}
// Please write your answer in the lines above.
  return dollars;
}
node v10.16.0