Ad
  • Default User Avatar

    Of course, how silly of me! Currently on a bootcamp and constantly having it drummed into us not to mutate inputs.

    Thanks very much. Your speedy assistance, and indeed your work on the kata in the first place, is massively appreciated!

  • Custom User Avatar

    I'm unable to see your full code, so I can't replicate the problem. However, based on the error message, it looks like you're mutating the input. Try to avoid doing that and see if the error persists.

  • Default User Avatar

    I'm having a little trouble with the JS version of this Kata. Been enjoying the challenge and my code is partially working but at a stage where seeing the results of the tests is crucial to figuring out exactly what string to return in some cases. Unfortunately, when I run the tests, the failures display an error from the testing code rather than an "expected x but got y" style error.

    The sample tests run fine, with no errors. And the lines in the error message all seem to refer to parts of the testing code rather than being directly related to my own code. The problem could still be with my own code because if I delete parts of my inspect method, the errors go away, but I can't see anything wrong with the code in question.

    Please could anybody shed any light on what might be going wrong? The testing code seems to run one inspection on each day before returning the error below:

    TypeError: dx[e].split is not a function

    at docNames.map.e
    
    at Array.map
    
    at funkDoc
    
    at entrantList.forEach.e
    
    at Array.forEach
    
    at /home/codewarrior/index.js:431:16
    
    at begin
    
    at it
    
    at /home/codewarrior/index.js:408:3
    
    at /runner/frameworks/javascript/cw-2.js:152:11
    
    at Promise._execute
    
    at Promise._resolveFromExecutor
    
    at new Promise
    
    at describe
    
    at /home/codewarrior/index.js:303:1
    
    at /home/codewarrior/index.js:445:5
    
  • Default User Avatar

    It's not really a duplicate, is it. Likely solutions might have some parallels (and thanks to your comment I'm going to see if I can adapt my code to solve that kata) but multiplication and exponentiation are slightly different.