The issue is that the code works perfectly well in chrome but fails in firefox. not sure of the cause. Used your code as a base for creating my own. Any ideas why it would work in chrome but not firefox?
It is a compile-time error if a statement cannot be executed because it is unreachable. This means that the control flow of your program can’t get to that statement, but you assume that they would be. The compiler analyzes the flow, and reports these statements to you as error messages. It is a reliable indicators of logical error in your program.