-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (19 loc) · 922 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const Reader = require("./lib/utils/Reader");
const ExplorerService = require("./lib/services/ExplorerService");
const explorers = Reader.readJsonFile("explorers.json"); // esto regresa la lista de explorers del archivo
//console.log(explorers)
const explorersInNode = explorers.filterByMission((explorer) => explorer.mission == "node");
console.log(explorersInNode.length);
const usernamesInNode = explorersbyMission.map((explorer) => explorer.Username == "node");
//console.log(usernamesInNode.length)
const assignFizzBuzzTrick = function(explorer){
if(explorer.score%5 === 0 && explorer.score%3 === 0){
explorer.trick = "FIZZBUZZ";
return explorer;
}else{
explorer.trick = explorer.score;
return explorer;
}
};
const explorersInNodeAndFizzBuzzTrick = explorersbyMission.map((explorer) => assignFizzBuzzTrick(explorer));
//console.log(explorersInNodeAndFizzBuzzTrick);