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


#1

any one suggest alternative for this!

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

#2

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


#3

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