Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Exercises/1-hoisting.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
'use strict'

const fn = null;
const fn = () =>{
const a = 5;
};

module.exports ={fn };
2 changes: 1 addition & 1 deletion Exercises/2-by-value.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
'use strict'

const inc = null;
const inc = a => ++a;

module.exports ={inc };
6 changes: 5 additions & 1 deletion Exercises/3-by-reference.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
'use strict'

const inc = null;
const inc = num =>{
if (typeof num === 'object'){
++num.n;
}
};

module.exports ={inc };
10 changes: 9 additions & 1 deletion Exercises/4-count-types.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
'use strict'

const countTypesInArray = null;
const countTypesInArray = array =>{
const obj ={};
array.forEach(item =>{
const type = typeof item;
const count = obj[type] || 0;
obj[type] = count + 1;
});
return obj;
};

module.exports ={countTypesInArray };
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.