-
Notifications
You must be signed in to change notification settings - Fork 169
feat: Resolve basic objects tasks #141
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
b281059
506c93c
053cd73
64ff99d
94d5667
018f7f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,10 @@ books.getAuthor = function (isbn) { | |
| }; | ||
|
|
||
| books.getTitle = function (isbn, lang) { | ||
| if (typeof this[isbn] === 'undefinej') { | ||
| return null; | ||
| } | ||
|
|
||
| if (typeof this[isbn]['title'][lang] === 'undefined') { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warto sprawdzić jeszcze poprzedni element tj. "isbin" jeśli ten element nie istnieje to kod rzuci błędem i przestanie działać reszta. Obecne rozwiązanie sprawdza tylko czy |
||
| return null; | ||
| } | ||
|
|
@@ -55,6 +59,10 @@ books.getTitle = function (isbn, lang) { | |
| }; | ||
|
|
||
| books.getTranslator = function (isbn, lang) { | ||
| if (typeof this[isbn] === 'undefinej') { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| return null; | ||
| } | ||
|
|
||
| if (typeof this[isbn]['translator'][lang] === 'undefined') { | ||
| return null; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍