-
Notifications
You must be signed in to change notification settings - Fork 2
hw_2 #1
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?
hw_2 #1
Conversation
| // Task 5 | ||
| function getSum(a,b){ | ||
| let result = 0; | ||
| if (!Number.isInteger(a) && !Number.isInteger(b) || (a > b)){ |
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.
Small mistake.
You need || here !Number.isInteger(a) && !Number.isInteger(b)
| else if (height > width) | ||
| { | ||
| console.log(height); | ||
| else if ( a == b){ |
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.
always use ===
| function fooboo(a,foo,boo) | ||
| { | ||
|
|
||
| (typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again"); | ||
| } | ||
| // fooboo(f,foo,boo); |
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.
please use syntax as
function test {
body here
}
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.
(typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again");
Very hard to read
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.
зато в одну строку C:
| function fooboo(a,foo,boo) | ||
| { | ||
|
|
||
| (typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again"); | ||
| } | ||
| // fooboo(f,foo,boo); |
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.
(typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again");
Very hard to read
| const registerProperty = { | ||
| login: "", | ||
| pass: "", | ||
|
|
||
|
|
||
| validate: function(login,pass){ | ||
| (login === this.login && pass === this.pass) ? alert("all right"):alert("try again"); | ||
| }, | ||
| } |
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.
Красиво!
| const objTwo = { | ||
| name: "banana", | ||
| size: 30, | ||
| } | ||
| // console.log(objTwo.name? true : false); |
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.
Тут скорее про ключ что может быть любым передаваемым. Т.е. функция которая принимает параметром ключ и возвращает true или false при его наличии
| // непонятно зачем по очереди надо вывести, почему нельзя сразу ٩(˘◡˘)۶ | ||
| // for(let key in student){ | ||
| // console.log(`${key}`) | ||
| // } | ||
| // for(let key in student){ | ||
| // console.log(`${student[key]}`) | ||
| // } |
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.
чтобы уметь брать только 1. Задачи для практики разных подходов.
Это мой первый пул реквест, надеюсь сделал все правильно.