From 69f459b93130541938c7ec81cb23e7f426960862 Mon Sep 17 00:00:00 2001 From: Oleksii Krylov Date: Tue, 9 Sep 2025 13:39:16 +0200 Subject: [PATCH 1/4] 01 Done --- 01/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/01/app.js b/01/app.js index e69de29..4f24587 100644 --- a/01/app.js +++ b/01/app.js @@ -0,0 +1,8 @@ +const user = { + firstName: 'Oleksii', + lastName: 'Krylov', + sex: 'male', + age: 29 +} + +console.log(user) \ No newline at end of file From edf0a8f868ea34bfc8b00a8ab059ae6619584372 Mon Sep 17 00:00:00 2001 From: Oleksii Krylov Date: Tue, 9 Sep 2025 13:56:30 +0200 Subject: [PATCH 2/4] 02 Done --- 02/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/02/app.js b/02/app.js index a70d947..9a4c1e4 100644 --- a/02/app.js +++ b/02/app.js @@ -8,4 +8,14 @@ const calendarJS = { 'ES7': '2016-06', 'ES8': '2017-06', 'ES9': '2018-06', +} + +for(const key in calendarJS) { + // console.log (key, calendarJS[key]) + const value = calendarJS[key] + if(value === null) { + console.log(' ES4 nie zostało wydane') + }else { + console.log(key + ' wydane terminie ' + value) + } } \ No newline at end of file From a690bb1e119ba15d60a93600468bc6c0be44f552 Mon Sep 17 00:00:00 2001 From: Oleksii Krylov Date: Wed, 10 Sep 2025 09:41:09 +0200 Subject: [PATCH 3/4] 03 Done --- 03/app.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/03/app.js b/03/app.js index 3ab7c52..984ccfc 100644 --- a/03/app.js +++ b/03/app.js @@ -42,14 +42,51 @@ books.getAuthor = function(isbn) { } books.getTitle = function(isbn, lang) { + if(typeof this[isbn] === 'undefined') { + + return null; + } + + if(typeof this[isbn]['title'] === 'undefined'){ + + return null; + } + + const title = this[isbn]['title'][lang]; + + if(title) { + return title; + } + + return null; + + } books.getTranslator = function(isbn, lang) { + if (typeof this[isbn] === 'undefined') { + return null; + } + + if (typeof this[isbn]['translator'] === 'undefined') { + return null; + } + + const translator = this[isbn]['translator'][lang]; + + if (translator) { + return translator; + } + + + return false; } + + console.log( books.getAuthor('978-83-7278-000-3') ); // J.K. Rowling console.log( books.getAuthor('000-00-0000-000-0') ); // null console.log( books.getTitle('978-83-7278-000-3', 'pl') ); // Harry Potter i Kamień Filozoficzny From 36f0f34093efda805787a1523b14aa5be370950c Mon Sep 17 00:00:00 2001 From: Oleksii Krylov Date: Wed, 10 Sep 2025 10:06:56 +0200 Subject: [PATCH 4/4] 04 Done --- 04/app.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/04/app.js b/04/app.js index 1090571..67ef2e1 100644 --- a/04/app.js +++ b/04/app.js @@ -2,8 +2,22 @@ const user = { firstName: 'Adam', lastName: 'Nowak', born: { - day: '14', - month: '04', + day: '10', + month: '09', year: '1985' } -} \ No newline at end of file +} + +const today = new Date(); + +const todayDay = today.getDate(); +const todayMonth = today.getMonth() + 1; + +const userDay = Number(user.born.day); +const userMonth = Number(user.born.month); + +if (todayDay === userDay && todayMonth === userMonth ) { + console.log ('it is birthday day ' + user.firstName ); +} else { + console.log ('it is not birthday day ' + user.firstName) +}