Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions 01/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
user = {
firstName: 'Jan',
lastName: 'Kowalski',
sex: 'male',
age: 27
}

console.log(user)
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.

👍

10 changes: 10 additions & 0 deletions 02/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ const calendarJS = {
'ES7': '2016-06',
'ES8': '2017-06',
'ES9': '2018-06',
}

for (const version in calendarJS) {
const releaseDate = calendarJS[version];

if (releaseDate) {
console.log(`${version} wydano w terminie ${releaseDate}`);
} else {
console.log(`${version} nie zostało wydane`);
}
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.

👍

}
20 changes: 17 additions & 3 deletions 04/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ const user = {
firstName: 'Adam',
lastName: 'Nowak',
born: {
day: '14',
month: '04',
day: '19',
month: '08',
year: '1985'
}
}
}

function checkBirthday(user) {
const today = new Date();
const currentDay = String(today.getDate()).padStart(2, '0');
const currentMonth = String(today.getMonth() + 1).padStart(2, '0');

if (user.born.day === currentDay && user.born.month === currentMonth) {
console.log(`Dzisiaj są urodziny użytkownika ${user.firstName} ${user.lastName}!`);
} else {
console.log(`Dzisiaj nie są urodziny użytkownika ${user.firstName} ${user.lastName}.`);
}
}

checkBirthday(user);
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.

👍