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:
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.
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
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.
No prob, I'm glad I could help.
Of course! Thanks for taking the time to help me out. I really enjoyed your kata.
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:calling
toTable([["lorem", "ipsum"], ["dolor", "sit amet"]], true, true)
:You need to get rid of the square brackets in signature if you want this code to work.
This comment is hidden because it contains spoiler information about the solution
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.
Not a kata issue, yes. @jonnybolt: use the "question" flag, for this kind of things. The error comes from your code.
Three days without an answer - I assume that this issue is resolved.
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.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
What error do you get?
Not sure what's going on, but the tests are complaining when I use .map on any arrays. Do I have something misconfigured?
You have to complete a kata, and then you'll be able to translate it to other languages.
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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...