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.
:)
should be better now
You don't need
map
if you don't need to create a new array. You can use.forEach
if you just want to iterate through the array.If you do it like that, won't it do the divison in every iteration? On top of that, it divides before adding
ageSum
.What is the meaning of !String ? can you explain it?
i think it was from your early days of learning isn't it? i just explained to look documentation because i thought your are a beginner at coding.
don't call it as a solution 🤣
I want to find my own solution)
everything went smoothly until i saw this kata 😂 i used a brute force method and it didn't workout well. i'll bookmark this and come back after i learn JS better 😵
but only if it's one line if the arrow function consist of more than one line we need to explicitly write 'return' in our code.
clone the array before modifying it! this is the best practice 🙂
modifying a function's parameters with splice is not a good practice(because it's permanently change the original array). make a copy of the array and modify it 🙂
This comment is hidden because it contains spoiler information about the solution
to be honest i got annoyed at first because the round is not working on some cases then got to know about num.toFixed(2) and it solved the issue. thank you for making me more stronger
if you just spent 10min on StackOverflow you don't have to write some code like this! do the research and you don't need to write code from the top of your head. refer documentation and use google when you are stuck! 🙂
Loading more items...