forked from den-wdi-2/js-building-iterators-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (27 loc) · 861 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
27
28
29
30
31
32
33
34
35
var myEach = require('./myEach');
var myMap = require('./myMap');
var myReduce = require('./myReduce');
/* *********************************************************************
You can edit this file
It will make use of your code in myEach.js, myMap.js and myReduce.js
To run it on the console do: `node index.js`
***********************************************************************/
var numArray = [0,1,10,100,1000];
/* myEach */
//
/*
myEach(numArray, function print(element, index, arr) {
console.log('inside myEach', element, index, arr);
});
*/
/* myMap */
/*
var input = ["a","b","c"];
var output = myMap(input, function capitalize(v){
return v.toUpperCase();
});
console.log('Testing myMap');
console.log(output);
console.log(output[0] === "A" && output[1] === "B" && output[2] === "C"); // assertion
console.log("the end");
*/