['A', 'B', 'Start', 'C', 'D', 'E', 'Stop', 'F', 'G'].select do |x|
true if (x == 'Start') .. (x == 'Stop')
end
=> ["Start", "C", "D", "E", "Stop"]
Lint/FlipFlop: Avoid the use of flip-flop operators.
['A', 'B', 'Start', 'C', 'D', 'E', 'Stop', 'F', 'G'].select do |x|
true if (x == 'Start') .. (x == 'Stop')
end
=> ["Start", "C", "D", "E", "Stop"]
Lint/FlipFlop: Avoid the use of flip-flop operators.