Ad
  • Default User Avatar

    Yeah, I got it since then. I'm not sure about split

  • Default User Avatar

    It's only one loop!

    One loop deep, maybe. How can you sort() a thing without looping over it? And I'm out of my league so I'll just ask: does str1.split('') provide a new view into existing data, or does it have to loop over and copy data piece by piece into a new structure?

  • Default User Avatar
  • Default User Avatar

    Yeah JFC. I was so completely lost until I just ran a sample function logging the arguments and what was expected and it instantly made sense. What a convoluted mess of a description

  • Custom User Avatar

    feel "wtf" bcause 'details' section doesnt explain what to do with this construction (("Hello")("World!")("how")("are")("you?")()), and even with solutions i really can't understand how it all work, this kata feels like 5+ kyu difficulty for me

  • Default User Avatar

    Just take a look at how many times the function is being called, and if you're not returning anything, it can't call undefined("some string"), which is why you're seeing the error.

  • Default User Avatar

    hmm okay. I'll try to reevaluate. My apologies

  • Custom User Avatar

    it works correctly in JS. The task is a bit unusual, that's all.

  • Default User Avatar

    But I'm not returning anything?

  • Custom User Avatar

    but instead if throws a 'createMessage is not a function error'

    It may sound surprising, but this message shows up exactly because you're returning a string/undefined, instead of a function.

  • Default User Avatar

    I'm all ears if I am incorrect, but that's what I'm observing. Sorry, I am not tryng to sound arrogant I am totally aware that I could be wrong, but I have never seen anything like this before. Please correct me if I'm wrong.

  • Default User Avatar

    No, I tested it out with just the most basic function declaration. It obviously should fail the specs but instead if throws a 'createMessage is not a function error'. The problem isn't my code, it is that the assert function is calling createMessage inappropriately.

    function createMessage() {
    console.log('This is a function')
    }

  • Custom User Avatar

    it calls the function inappropriately

    As far as I can tell, the only thing that's broken here is your solution. The description has an example of how it's supposed to work, so you can have a general idea about what to expect - if you don't know how to achieve this, how come it's the kata's fault?

  • Default User Avatar

    This kata does not work for JS, as it calls the function inappropriately. It seems like a fun kata, would love to get this fixed.

  • Default User Avatar

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

  • Loading more items...