Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first commit #148

Closed
wants to merge 1 commit into from
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
5 changes: 5 additions & 0 deletions .idea/.gitignore

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

12 changes: 12 additions & 0 deletions .idea/DataTypes.iml

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

126 changes: 126 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

2 changes: 1 addition & 1 deletion Exercises.ua.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Вправи
x # Вправи

## Скалярні типи та посилання

Expand Down
5 changes: 0 additions & 5 deletions Exercises/1-hoisting.js

This file was deleted.

4 changes: 0 additions & 4 deletions Exercises/1-hoisting.test

This file was deleted.

4 changes: 3 additions & 1 deletion Exercises/2-by-value.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const inc = null;

const inc = (x) => ++x;


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



const inc = (obj) => {
console.log(obj);
if (typeof obj === 'object') {
obj.n++;
};
};

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

const countTypesInArray = null;
const countTypesInArray = (arr) => {
const typeCount = {};
for (const item of arr) {
const type = typeof item;
const Counter = typeCount[type] || 0;
typeCount[type] = Counter + 1;
}
return typeCount;
};


module.exports = { countTypesInArray };
2 changes: 1 addition & 1 deletion Solutions/4-count-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict';

const countTypesInArray = (arr) => {
const counters = {};
Expand Down