Skip to content

Conversation

@LevPollo
Copy link
Collaborator

Это мой первый пул реквест, надеюсь сделал все правильно.

// Task 5
function getSum(a,b){
let result = 0;
if (!Number.isInteger(a) && !Number.isInteger(b) || (a > b)){
Copy link
Owner

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){
Copy link
Owner

Choose a reason for hiding this comment

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

always use ===

Comment on lines +85 to +90
function fooboo(a,foo,boo)
{

(typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again");
}
// fooboo(f,foo,boo);
Copy link
Owner

@antonpatotski antonpatotski May 28, 2023

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
}

Copy link
Owner

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

зато в одну строку C:

Comment on lines +85 to +90
function fooboo(a,foo,boo)
{

(typeof a === "boolean")? ((a)?console.log("1"):console.log("2")): console.log("try again");
}
// fooboo(f,foo,boo);
Copy link
Owner

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

Comment on lines +200 to +208
const registerProperty = {
login: "",
pass: "",


validate: function(login,pass){
(login === this.login && pass === this.pass) ? alert("all right"):alert("try again");
},
}
Copy link
Owner

Choose a reason for hiding this comment

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

Красиво!

Comment on lines +142 to +146
const objTwo = {
name: "banana",
size: 30,
}
// console.log(objTwo.name? true : false);
Copy link
Owner

Choose a reason for hiding this comment

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

Тут скорее про ключ что может быть любым передаваемым. Т.е. функция которая принимает параметром ключ и возвращает true или false при его наличии

Comment on lines +154 to +160
// непонятно зачем по очереди надо вывести, почему нельзя сразу ٩(˘◡˘)۶
// for(let key in student){
// console.log(`${key}`)
// }
// for(let key in student){
// console.log(`${student[key]}`)
// }
Copy link
Owner

Choose a reason for hiding this comment

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

чтобы уметь брать только 1. Задачи для практики разных подходов.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants