repl.it
@launcherman08/

Question Test

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
// 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'
function exerciseTwo(cents) {
var dollars = cents.map(elem => elem / 100);
return dollars;
}
cents = [500, 200];
exerciseTwo(cents)