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.
This is rather good video, but Kyle Simpson made amazing explanation of how the 'new' work, and how everything is interlinked in his book series ' YOU dont know JS', also there is video seris based on the book, presented by KS. I highly recommend it.
It is good idear !!!!
@ZozoFouchtra has it exactly. A variable in JS can start with an underscore or a letter, and optionally be followed by any combination of letters, numbers, or underscores. So, it's just a way to visually "ignore" the argument.
Note: this might get you in trouble if you use libraries like LoDash or Underscore, since they (traditionally) are represented as
_
. In that case, I might simply use a single letter variable that I just don't use, likem
, in this case, for "match".I think the underscore as the first parameter means we don't need to use it in the function.
The function push the index (offset) of capital found in the word, not the capital itself( which should be the first argument of the callback function ). Underscore, in this case, is kind of naming convention to say "i know it should be an argument here but i will not use it"
see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Quite simple, really - you've got the keys and values backwards. You're returning this:
[[1, 2, 3], ['a', 'b', 'c']]
Thanks, this helped a lot.