This doesn't work for odd numbers:
This comment is hidden because it contains spoiler information about the solution
spoiler flag, plz...
.slice is both an array function and a string function that essentially have the same behavior. So just to be clear, it doesn't return an array in this instance, it returns a string (more specifically a substring of the string it was called on).
Just realised I didn't mean Simple SQL Engine, I meant Functional SQL.
Happy coding ^^
( Did you do Simple SQL Engine yet? Finishing that gave me the same buzz as I suspect you now have. Recommended! )
I finally did it. I've been working on this for like 2 weeks. Great kata; I learned a lot.
This is fixed.
Fixed tests and sample tests are not well written: people write tests like this in the past because they didn't know how to write tests.
If you already know the exact value, just test against the expected, exact value. Testing against length and other stuff is pointless (unless somehow you're using JQuery and monkey-patched an array or something).
Also they should be updated to use Test.assertDeepEquals too.