Skip to content

Commit 23b27eb

Browse files
author
KatieAJenkins
committed
gaa
1 parent 46376f4 commit 23b27eb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

reduce/core.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function productAll (array) {
3939
console.log(productAll(input1));
4040

4141

42-
var input2 = [[ 'Thundercats', '80s' ],
43-
[ 'The Powerpuff Girls', '90s' ],
44-
[ 'Sealab 2021', '00s' ]];
42+
var input2 = [[ 'Thundercats', '80s' ], //row
43+
[ 'The Powerpuff Girls', '90s' ], //row
44+
[ 'Sealab 2021', '00s' ]]; //row
4545
// var expected = { 'Thundercats': '80s',
4646
// 'The Powerpuff Girls': '90s',
4747
// 'Sealab 2021': '00s' };
@@ -54,18 +54,22 @@ function objectify (array) {
5454
//create cartoonObject
5555
//return cartoonObject starting variable
5656
return array.reduce(function(cartoonObject, row){
57-
console.log('row ', row[0]);
58-
console.log('row2 ', row[1]);
57+
// console.log(row);
58+
// console.log('row ', row[0]);
59+
// console.log('row2 ', row[1]);
60+
//build up cartoonObject object[key]
5961
cartoonObject[row[0]] = row[1];
60-
console.log('cartoonObject ', cartoonObject);
62+
// console.log('cartoonObject ', cartoonObject);
6163

62-
console.log(cartoonObject);
64+
// console.log('cartoon Object ', cartoonObject);
6365
return cartoonObject;
6466
},
6567
{});
6668
}
6769

68-
objectify(input2);
70+
//to get cartoonObject without console logging before return
71+
console.log(objectify(input2));
72+
6973

7074
function luckyNumbers (array) {
7175
// your code here

0 commit comments

Comments
 (0)