thanks so much but why are they using regex to test the code?.. now clean code is seen as its wrong causing a bug that someone cannot solve… it can cause headache
It is what it is. A lot of the code is difficult to test “dynamically” because when we do not have access to the running code. There are a few other options, but they often do not work.
because you put the code all one line, and I didn’t notice the comma, that’s why my comment was ‘you have too many comparisons’.
But as lasjorg said, that wasn’t the problem. (it was just the way you put all the code on one line that made me think you were trying to use two operators at once)
I would definitely suggest you abide by the 80 column rule of formatting (or there about). If the elements in an array take up that much horizontal space, they should be on a new line.
It is just too hard to read when code is allowed to continue so far to the right.
no need to apologize. It is considered good practice to format your code before posting it online for someone to read, but it is understandable either way.