+ 1

How to make input in if else statements in Javasript?

input in if else

6th May 2018, 7:29 AM
Eli Ben Shimon
Eli Ben Shimon - avatar
7 Answers
+ 6
if (true) input = prompt() // else... alert(input)
6th May 2018, 7:42 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
var x; if(...) { x=prompt(...); } else { x=prompt(...); }
6th May 2018, 7:39 AM
Kawaii
Kawaii - avatar
+ 3
if(predicate) { true_variant = prompt("Your predicate is true, enter some data", ""); //... } else { false_variant = prompt("Your predicate is false, enter some data", ""); //... }
6th May 2018, 6:17 PM
Dmitriy
Dmitriy - avatar
+ 1
@donna thanks!!!!!
6th May 2018, 7:38 AM
Eli Ben Shimon
Eli Ben Shimon - avatar
0
@Kawaii thanks!!!😊
6th May 2018, 7:40 AM
Eli Ben Shimon
Eli Ben Shimon - avatar