Hi,
I think you’re right, It could be simpler to do it like that.
I have checked “localeCompare”, it does compare case sensitive strings but it
doesn’t compare strings in an array and to do it, you will have to execute the
method as many times as strings in an array. By using ignoreCase
on converts all of the strings, which the developer chose to the
lower case. After performing the previous operation, it compares all of
them. If at least one, equals the provided parent string, then the function
returns true.
You can the proposal on my GitHub:
https://github.com/robertjwoznia
2 matches
Mail list logo