Skip to content
Open

done #135

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: 4 additions & 0 deletions 01/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const users = ['Maria Kaczyńska', 'Jarosław Boberek', 'Danuta kołaczkowska', 'Mariusz Pudzianowski', 'Bolesław Leśmian'];

console.log(users[0], '+', users[2], '+', users[4]);
console.log(users.length);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

11 changes: 11 additions & 0 deletions 02/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
const randomArray = createRandomArray();
console.log(randomArray);
const lastIndex = randomArray.length -1;

for(let i=0; i<randomArray.length; i++) {
console.log(randomArray[i]);
}

randomArray.forEach(function(element) {
console.log(element);
});


console.log(randomArray[lastIndex]);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍



// nie modyfikuj kodu poniżej!
Expand Down
13 changes: 11 additions & 2 deletions 03/app.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
const n = 24;
const oddNumbers = [];
const n = 55;
const oddNumbers = [];


for (let i=1; i<=n; i++) {
if(i % 2 !== 0) {
oddNumbers.push(i);
}
}

console.log(oddNumbers);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

6 changes: 5 additions & 1 deletion 04/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
const years = [1980, 1934, 2002, 2019];
const years = [1980, 1934, 2002, 2019];
const currentYear = 2021;
const yearsAgo = years.map( year => currentYear - year );

console.log(yearsAgo);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

13 changes: 12 additions & 1 deletion 05/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
const numbers = [1, 2, 3, 4, 5, 6, 7];
const numbers = [1, 2, 3, 4, 5, 6, 7];


const evenNumbers = numbers.filter(function(value) {
return value % 2 === 0;
});

const sumEvenNumbers = evenNumbers.reduce((accumulator, currentValue) => {
return accumulator + currentValue;
}, 0);

console.log(sumEvenNumbers);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍