Ad
  • Custom User Avatar

    use strict really don't need , and i am just don't understand why so many stars to that case

  • Default User Avatar

    In this case, since it is just using the Array.prototype.join() method to join each array element with a space, it doesn't really benefit from "use strict".

  • Custom User Avatar

    Thank you for the info. I'm still struggling to see what restrict mode exactly accomplishes in this particular problem. Are there any problems with the join method?

  • Custom User Avatar

    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.

  • Default User Avatar

    I really have a feeling that I'm overthinking this WAY TOO MUCH, and the answer is going to be something simple. If that's the case, then I think that makes this a really good kata. Reminds me that some times I have the tendency to over-complicate my programs in lieu of a simple approach. Now, back to this madness...

  • Custom User Avatar

    It is good idear !!!!

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    what does use strict mean?

  • Custom User Avatar

    @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, like m, in this case, for "match".

  • Default User Avatar

    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

  • Default User Avatar

    Hey, I like the way you solved this. I was wondering about the underscore as the first parameter of the callback function to the replace method. Is that a variable to the regular expression? You can put whatever you want for that parameter? Sorry if the question is stupid. I'm relatively new to this.
    Thanks!

  • Custom User Avatar

    Quite simple, really - you've got the keys and values backwards. You're returning this: [[1, 2, 3], ['a', 'b', 'c']]

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    As more of a Padwan then Jedi here in javaScript, I was under the illusion that mixing object literals and prototype construction is not particularly good practice. Despite this, its very unclear from the instructions what is expected in regards of the term "function" and passing "this". One can only use "this" if an object has been created with a function (function MyObject(){}). So where one is supposed to pass the "this" to an object literal "MyObject {}" is either a poorly written instruction that the likes of us mere mortals can't get a grasp on, or there is something more elusive and complex at work.

    "Next, it sets the new object’s .proto property to match the prototype property of the function being invoked."

    -- What function being invoked ? -- the object is an object literal not a function

    "Finally, the operator invokes the function and passes the new object as the “this” reference."

    ---- This doesnt read clearly in English or Tech Speak ---

    Am I missung something major here, and being a Homer Simpson, or is there actually a lack of clarity when writing the task? A nose in the right direction would eb of great help to us javaScript pond life

  • Default User Avatar

    Thanks, this helped a lot.

  • Loading more items...