Beta

Array Imposter (a.k.a. String Undercover)

Description
Loading description...
Arrays
Strings
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    No random tests?

    • sirRodge Avatar

      hey there Voile, thank you, can you let me know what you mean? Perhaps give me an example of a random test or point me to a kata that has one visible in its example tests

    • Voile Avatar

      Katas require random tests so users can't just pattern-match the input in the fixed tests.

      Most katas have random tests nowadays, so just solve one and look at how the tests are written ;-)

  • Ismail Avatar

    Does not provide any failure messages. Besides that, nice idea and nice kata. Thank you

    • sirRodge Avatar

      Thanks! Would you mind providing an example of a Test that provides a failure message? :)

    • Ismail Avatar

      Did you disable console.log somehow? I think your tests should already output some failure message! Best practice would be to be more descriptive though. For instance:

      Test.describe("Testing 'mutators'", function(){
          Test.it ("pop", function(){
            Test.assertEquals(stringArray("1,hey,3","pop"), "1,hey", "'pop' failed");
          });
          // ...
      });
      
      Test.describe("Testing 'properties'", function(){
        // length etc
      });
      
    • sirRodge Avatar

      Don't think I disabled console.log, at least not intentionally. Added failure messages :)

    • Ismail Avatar

      I think my browser addon (uMatrix) was blocking parts of the output... Thanks

  • Ismail Avatar

    There is a little typo in the description: "jsFunction" [...] which should jst return the corresponding array property value"

  • Ismail Avatar

    Why is the solution area prefilled with var websites = [];? Would it not be better to start with sth like:

    function stringArray(arrayStr, functionOrProperty, optionalArgs) {
      // Your code here
    }