I have nested if else statements, which I added below in two statements, Instead of having a lot of lines I am looking to shorthand it.
Can anyone help me out.
Statement : 1 can be written as,
abc = (a !== -1 && b!== -1) ? "hai" : (c !== -1 && d!== -1) ? "hello" : "hurray";
So based on this try to write your own code for the statement 2 [Hint : use switch for that]