Skip to content

Refactored code#1

Open
nazarbodan-indeema wants to merge 2 commits intoShaliapyn:mainfrom
nazarbodan-indeema:main
Open

Refactored code#1
nazarbodan-indeema wants to merge 2 commits intoShaliapyn:mainfrom
nazarbodan-indeema:main

Conversation

@nazarbodan-indeema
Copy link
Copy Markdown

Refactor code

let strResult = "";
for (let i = 0; i < str.length; i++){
if (str[i].toUpperCase() == str[i]){
strResult += str[i].toLowerCase()
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Дотримуйтесь одного стилю написання коду, якщо ставите крапку з комою, то ставте скрізь

// console.log("Browser is doing wzzhhhh")
// }

while (true) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Можна використати while(true) замість for цикла і змінної.

@@ -1,4 +1,8 @@
let i = 3;
for (let i = 0; i > 2; i++) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

for (let i = 3; i > 2; i++) - і тоді верхня змінна let i = 3; є непотрібною.

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.

1 participant