Skip to content

all in 1 #66

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Exercises/1-let.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

let name = undefined;
let name = 'Illia';

module.exports = { name };
2 changes: 1 addition & 1 deletion Exercises/2-const.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

const year = undefined;
const year = 2004;

module.exports = { year };
5 changes: 3 additions & 2 deletions Exercises/3-hello.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const hello = null;

const hello = (name) => {
console.log(name);
};
module.exports = { hello };
11 changes: 10 additions & 1 deletion Exercises/4-range.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';
const range = (start, end) => {
const len = end - start;
if (len < 0) return [];
const arrey = [];
let a = 0;
for (let i = start; i <= end; i++, a++)
arrey[a] = i;
return arrey;

const range = null;

};

module.exports = { range };
13 changes: 11 additions & 2 deletions Exercises/5-range-odd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';
const rangeOdd = (start, end) => {
const len = end - start;
if (len < 0) return [];
const arrey = [];
let a = 0;
for (let i = start; i <= end; i++) {
if (i % 2 === 0) continue;

const rangeOdd = null;

arrey[a++] = i;
}
return arrey;
};
module.exports = { rangeOdd };
15 changes: 11 additions & 4 deletions Exercises/6-calculate.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
'use strict';

const square = null;
const square = (x) => x * x;

const cube = null;
const cube = (x) => x ** 3;

const average = null;
const average = (a, b) => (a + b) / 2;

const calculate = () => {
const mas = [];
for (let i = 0; i <= 9; i++) {
mas[i] = average(square(i), cube(i));
}
return mas;
};

const calculate = null;

module.exports = { square, cube, average, calculate };
10 changes: 9 additions & 1 deletion Exercises/7-objects.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
'use strict';

const fn = null;
const fn = () => {

const obiekt1 = { name: 'AAA', };
let obiekt2 = { name: 'BBB', };

obiekt1.name = 'TTT';
obiekt2.name = 'CCC';
obiekt2 = { name: 'LLL', age: 10 };
};

module.exports = { fn };
6 changes: 5 additions & 1 deletion Exercises/8-create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

const createUser = null;
const createUser = (name, city) => {
const Person = { name, city };
return Person;
};


module.exports = { createUser };
13 changes: 11 additions & 2 deletions Exercises/9-array.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
'use strict';

const phonebook = null;
const phonebook = [
{ name: 'M', phone: '123' },
{ name: 'A', phone: '456' },
];

const findPhoneByName = (name) => {
for (const r of phonebook) {
if (r.name === name)
return r.phone;
}
};

const findPhoneByName = null;

module.exports = { phonebook, findPhoneByName };
9 changes: 6 additions & 3 deletions Exercises/a-hash.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict';

const phonebook = null;

const findPhoneByName = null;
const phonebook = {
M: 123,
A: 456,
};

const findPhoneByName = (name) => phonebook[name];
console.log(findPhoneByName('A'));
module.exports = { phonebook, findPhoneByName };
4 changes: 2 additions & 2 deletions JavaScript/1-identifiers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const INTERVAL = 500;
const INTERVAL = 500000;
let counter = 0;
const MAX_VALUE = 10;
let timer = null;
Expand All @@ -16,4 +16,4 @@ const event = () => {
};

console.log('Begin');
timer = setInterval(event, INTERVAL);
timer = setInterval(event, 500);
3 changes: 2 additions & 1 deletion Solutions/4-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const range = (begin, end) => {
return array;
};

module.exports = { range };
console.log(range(10, 100));
//module.exports = { range };
Loading