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

Refresh repo #147

Merged
merged 4 commits into from
Sep 19, 2024
Merged
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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

272 changes: 0 additions & 272 deletions .eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions Exercises.ua.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

Підготуйте дві реалізації функції `inc`:

2. З сигнатурою `inc(n: number): number`,
- З сигнатурою `inc(n: number): number`,
приклад виклику: `const a = 5; const b = inc(a); console.dir({a, b});`
3. З сигнатурою `inc(num: Num)`, де `Num` є об'єктом з полем `n`,
- З сигнатурою `inc(num: Num)`, де `Num` є об'єктом з полем `n`,
щоб функція змінила поле вихідного об'єкта, переданого за посиланням,
приклад виклику `const obj = { n: 5 }; inc(obj); console.dir(obj);`

## Типи об'єктів
## Типи даних

4. Підрахунок елементів різних типів у масиві.
Підрахунок елементів різних типів у масиві.

- Створіть вихідний масив, що містить значення різних типів, як
елементів, наприклад: `[true, 'hello', 5, 12, -200, false, false, 'word']`
Expand Down
2 changes: 1 addition & 1 deletion Exercises/1-hoisting.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
({
name: 'fn',
length: [20, 150]
length: [20, 150],
})
4 changes: 2 additions & 2 deletions Exercises/2-by-value.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[-1, 0],
[10000, 10001],
],
test: inc => {
test: (inc) => {
const a = 5;
const b = inc(a);
if (a === b) throw new Error('Result should not be equal to argument');
if (typeof b !== 'number') throw new Error('Result should be Number');
}
},
})
4 changes: 3 additions & 1 deletion Exercises/3-by-reference.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const inc = null;
const inc = (obj) => {
console.log(obj);
};

module.exports = { inc };
4 changes: 2 additions & 2 deletions Exercises/3-by-reference.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[{ n: -1 }, undefined],
[{ n: 10000 }, undefined],
],
test: inc => {
test: (inc) => {
const arg = { n: 5 };
const result = inc(arg);
if (typeof result !== 'undefined') {
Expand All @@ -17,5 +17,5 @@
const res = JSON.stringify(arg);
throw new Error(`Case failed: expected {"n":6}, result: ${res}`);
}
}
},
})
2 changes: 1 addition & 1 deletion Exercises/4-count-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[[true, true, false], { 'boolean': 3 }],
[[1, true, 'hello'], { 'number': 1, 'boolean': 1, string: 1 }],
[[1, 2, true, false, 'a', 'b'], { 'number': 2, 'boolean': 2, string: 2 }],
]
],
})
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2023 How.Programming.Works contributors
Copyright (c) 2017-2024 How.Programming.Works contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading