@@ -39,9 +39,9 @@ function productAll (array) {
39
39
console . log ( productAll ( input1 ) ) ;
40
40
41
41
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
45
45
// var expected = { 'Thundercats': '80s',
46
46
// 'The Powerpuff Girls': '90s',
47
47
// 'Sealab 2021': '00s' };
@@ -54,18 +54,22 @@ function objectify (array) {
54
54
//create cartoonObject
55
55
//return cartoonObject starting variable
56
56
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]
59
61
cartoonObject [ row [ 0 ] ] = row [ 1 ] ;
60
- console . log ( 'cartoonObject ' , cartoonObject ) ;
62
+ // console.log('cartoonObject ', cartoonObject);
61
63
62
- console . log ( cartoonObject ) ;
64
+ // console.log('cartoon Object ', cartoonObject);
63
65
return cartoonObject ;
64
66
} ,
65
67
{ } ) ;
66
68
}
67
69
68
- objectify ( input2 ) ;
70
+ //to get cartoonObject without console logging before return
71
+ console . log ( objectify ( input2 ) ) ;
72
+
69
73
70
74
function luckyNumbers ( array ) {
71
75
// your code here
0 commit comments