This comment is hidden because it contains spoiler information about the solution

I use print(given values) at the start of the function

And underscore _ used as a parameter name indicates that this parameter is meant to be ignored.

_

I put in a O(n) version

Your solution is O(n^2). The recursion is one n and the indexOf is another.

O(n^2)

n

indexOf

I'm new to codewars. Is it possible to see what the tests are other than the given sample ones?

sqrt?

A prime base > 16 will fox this, surely?

Can you see it? Another user was adding comments to my translation, so it should be visible.

Why the shortest one is always the best :D

Under Edit Kata, go to Translations, it's sitting there.

Because the string method used here may return a null which has no length property.

null

length

Perfect solution!

Not a definitve answer, is how i understand it: x evaluates that is not falsy value. x.length evaluates that the array has at least 1 element. the && expects that every operands is truthy starting from the left.

This comment is hidden because it contains spoiler information about the solution

I use print(given values) at the start of the function

And underscore

`_`

used as a parameter name indicates that this parameter is meant to be ignored.Your solution is

`O(n^2)`

. The recursion is one`n`

and the`indexOf`

is another.I'm new to codewars. Is it possible to see what the tests are other than the given sample ones?

sqrt?

A prime base > 16 will fox this, surely?

Can you see it? Another user was adding comments to my translation, so it should be visible.

Why the shortest one is always the best :D

This comment is hidden because it contains spoiler information about the solution

Under Edit Kata, go to Translations, it's sitting there.

Because the string method used here may return a

`null`

which has no`length`

property.This comment is hidden because it contains spoiler information about the solution

Perfect solution!

This comment is hidden because it contains spoiler information about the solution

Not a definitve answer, is how i understand it:

x evaluates that is not falsy value.

x.length evaluates that the array has at least 1 element.

the && expects that every operands is truthy starting from the left.

## Loading more items...