Skip to content
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

Нужно больше функций #2

Merged

Conversation

Khudorozhkova
Copy link
Contributor

@Khudorozhkova Khudorozhkova commented Sep 18, 2022

@keksobot keksobot changed the title Module2 task1 Нужно больше функций Sep 18, 2022
js/main.js Outdated
@@ -0,0 +1,15 @@
function getRandomInt(min, max) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

не решена часть задачи с проверкой min, max меньше нуля, min больше max

js/main.js Outdated
}


function checkStringLenght(str, maxLenght) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

мы договорились на прошлом занятии не использовать function declaration

js/main.js Outdated


function checkStringLenght(str, maxLenght) {
if (str.length <= maxLenght){
Copy link
Collaborator

Choose a reason for hiding this comment

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

так как условие уже само по себе и есть true/false то можно сразу вернуть результат проверки

@@ -0,0 +1,13 @@
const getRandomInt = (min, max) => {
if (min < 0 || max > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

max < 0

@keksobot keksobot merged commit e776cfb into htmlacademy-univer-javascript-1:master Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants