Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You're welcome and you learned something new too. Always check the docs when something doesn't work as you expect, and MDN is user-friendly.
LITERALLY ALL I HAD TO DO WAS CHANGE FOR..IN INTO FOR..OF. You are an absolute legend man
Thank you
Read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in#array_iteration_and_for...in
Array.prototype has an added method in the testing part and that's what you're seeing there with for...in, you have some other ways to iterate over an array, some listed in the link, for loop is one of them.
Meaning I should get the length of the array and use a traditional for loop? (Btw if you dont mind, why does for in cause this? The code works just as intended outside the tests, I checked and got the value I should've)
in JavaScript my code works fine, it returns the needed value, but in tests I get errors because a variable randomly becomes [Function], what is the cause of this ?
Many things can cause this. Make a research online and you'll get an idea. It's impossible to help you, we have no idea of what you are doing. See the documentation: https://docs.codewars.com/training/troubleshooting/
I pass all the basic tests but I get an UndefinedBehaviorSanitizer error when I attempt. Do you know the reason why?