Can't we use single prompt function two get two user values and store in two different variables in one line!


any one suggest alternative for this!

var user, x =prompt("SELECT TWO COLOR from this BLUE OR RANGE OR BLACK!").toUpperCase();.


You can always cram a whole program onto the same line, question is if that's really the best representation of your code.
As for prompting only once and taking two values, that's just a matter of considering what you need to do to the result to separate the two inputs that you'll be getting back


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.