-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: master
Are you sure you want to change the base?
done #1435
Conversation
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.
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')]; |
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.
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++) { |
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.
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; |
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.
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.
No description provided.