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

done #1435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

done #1435

wants to merge 1 commit into from

Conversation

EgorMamtsev
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Your code meets all the task requirements and constraints effectively! 🎉 While there are some suggestions for improving readability and preventing potential errors, such as checking if parented is not null before calling prepend, using a for...of loop, and considering Array.from() for converting NodeList to an array, these are minor improvements. They don't impact the core functionality of your solution. Keep up the great work, and consider these suggestions for future projects to enhance your code quality even further! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -1,3 +1,28 @@
'use strict';

// write code here
const inputsCollection = [...document.querySelectorAll('input')];

Choose a reason for hiding this comment

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

Consider using Array.from() instead of the spread operator for converting NodeList to an array. It is more explicit and can be more readable.

// write code here
const inputsCollection = [...document.querySelectorAll('input')];

for (let i = 0; i < inputsCollection.length; i++) {

Choose a reason for hiding this comment

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

Using a for...of loop instead of a traditional for loop can make the code more readable when iterating over arrays.


label.textContent = currentValue.toUpperCase();

const parented = inputsCollection[i].parentElement;

Choose a reason for hiding this comment

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

Consider checking if parented is not null before calling prepend. This will prevent potential errors if an input element does not have a parent element.

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