• After completing this kata (clicking "Attempt" and passing), then trying to test again (even with the same exact code), you get this error message (might be something else but that's how I've managed to get this to happen):

    /home/codewarrior/node/test.js:13

    ;(function() {

    ^

    SyntaxError: Unexpected token ;

    at new Script (vm.js:80:7)
    
    at createScript (vm.js:274:10)
    
    at Object.runInThisContext (vm.js:326:10)
    
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    
    at Module.load (internal/modules/cjs/loader.js:600:32)
    
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    
    at Module.require (internal/modules/cjs/loader.js:637:17)
    
    at require (internal/modules/cjs/helpers.js:22:18)
    
    at /home/codewarrior/node/node_modules/.registry.npmjs.org/mocha/5.2.0/node_modules/mocha/lib/mocha.js:250:27
    
    at Array.forEach (<anonymous>)
    
    at Mocha.loadFiles (/home/codewarrior/node/node_modules/.registry.npmjs.org/mocha/5.2.0/node_modules/mocha/lib/mocha.js:247:14)
    
    at Mocha.run (/home/codewarrior/node/node_modules/.registry.npmjs.org/mocha/5.2.0/node_modules/mocha/lib/mocha.js:576:10)
    
    at Object.<anonymous> (/home/codewarrior/node/node_modules/.registry.npmjs.org/mocha/5.2.0/node_modules/mocha/bin/_mocha:637:18)
    
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    
    at Module.load (internal/modules/cjs/loader.js:600:32)
    
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    
    at startup (internal/bootstrap/node.js:283:19)
    
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
    
  • Comparing indices in an array is not a novel idea.

  • I guess you should improve the tests and description.

    1. The description should be most specific which the 'a' is before 'm' in any position of array.

    The test should cover:

    • The case of 'a' is present but 'm' is not present in array.
      Ex: ['b','x','a','j']
    • The case of multiples 'm' one before and one after.
      Ex: ['m','i','a','j','m']
  • To save on endless quotes.

    Could have saved on all the spaces as well.

  • Approved.

  • Author has left the building. Any power user want to approve this?

  • Why showing an array as a string + split in the instructions?

  • JS version fixed. ;-)

  • JS version fixed. ;-)

  • JS version fixed. ;-)

  • JS version fixed. ;-)

  • Ruby kata and JS kata are different. What should we return in the JS Kata?

  • Yeah, there was a general CodeWars bug preventing any katas from being completed/submitted. It is fixed now, so go ahead and resubmit!

  • Loading more items...