• Custom User Avatar

    No prob, I'm glad I could help.

  • Custom User Avatar

    Of course! Thanks for taking the time to help me out. I really enjoyed your kata.

  • Custom User Avatar

    Well, in your function signature you are expecting a single array argument, so no wonder things aren't working the way they should. Calling toTable([["o"]], true, true) in your case gives:

    data == ["o"]
    header == false
    index == false
    

    calling toTable([["lorem", "ipsum"], ["dolor", "sit amet"]], true, true):

    data == ["lorem",  "ipsum"]
    header == ["dolor", "sit amet"]
    index == false
    

    You need to get rid of the square brackets in signature if you want this code to work.

  • Custom User Avatar

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

  • Custom User Avatar

    OK, will do. I have jest tests running locally and they all pass with the code as is. Not sure why it doesn't run in the Codewars environment.

  • Custom User Avatar

    Not a kata issue, yes. @jonnybolt: use the "question" flag, for this kind of things. The error comes from your code.

  • Custom User Avatar

    Three days without an answer - I assume that this issue is resolved.

  • Custom User Avatar

    It seems like you are trying to use map on a non-array type, deducting from the fact that this exception raises inside a call to rowData.map. There is no scenario in which there are other arrays inside a single row of the table. To be perfectly sure, I would need to see your code.

  • Custom User Avatar

    TypeError: x.map is not a function
    at rowData.map
    at Array.map
    at toTable
    at Test.describe
    at /runner/frameworks/javascript/cw-2.js:152:11
    at Promise._execute
    at Promise._resolveFromExecutor
    at new Promise
    at Object.describe
    at /home/codewarrior/index.js:71:6
    at /home/codewarrior/index.js:78:5
    at Object.handleError

  • Custom User Avatar

    What error do you get?

  • Custom User Avatar

    Not sure what's going on, but the tests are complaining when I use .map on any arrays. Do I have something misconfigured?

  • Custom User Avatar

    You have to complete a kata, and then you'll be able to translate it to other languages.

  • Custom User Avatar

    How do I modify an existing kata to support another programming language? I just completed a kata in javascript but the only language supported is haskell.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Loading more items...