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

fixes Warning issue in utils.js #3375

Merged
merged 1 commit into from
Nov 25, 2023
Merged

Conversation

Ashish020202
Copy link
Contributor

@Ashish020202 Ashish020202 commented Nov 22, 2023

This PR fixes the issue #3374
The warning is because the condition args === [] will always return false as JavaScript compares objects by reference, not by value. An empty array is an object, and using === to compare objects, it checks if they refer to the same object in memory.
To fix this, I used its length is 0 to determine if it's an empty array instead of using args===[ ].
@walterbender

@walterbender walterbender merged commit aaf0369 into sugarlabs:master Nov 25, 2023
3 checks passed
@walterbender
Copy link
Member

Thx.

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