+ 1

JS prompt - calculator (ΠΊΠ°Π»ΡŒΠΊΡƒΠ»ΡΡ‚ΠΎΡ€)

Help me, please. How to do in the calculator if you have not entered a number, then offer to enter again until you enter a number. And that would not count either 0 or nan. ΠŸΠΎΠΌΠΎΠ³ΠΈΡ‚Π΅ ΠΌΠ½Π΅, поТалуйста. Как Π² ΠΊΠ°Π»ΡŒΠΊΡƒΠ»ΡΡ‚ΠΎΡ€Π΅ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ Ссли Π²Π²Π΅Π»ΠΈ Π½Π΅ Ρ†ΠΈΡ„Ρ€Ρƒ, Ρ‚ΠΎ ΠΏΡ€Π΅Π΄Π»Π°Π³Π°Ρ‚ΡŒ Π΅Ρ‰Π΅ Ρ€Π°Π· ввСсти, ΠΏΠΎΠΊΠ° Π½Π΅ Π²Π²Π΅Π΄Π΅Ρ‚ Ρ†ΠΈΡ„Ρ€Ρƒ. И Ρ‡Ρ‚ΠΎ Π±Ρ‹ Π½Π΅ считал ΠΈΠ»ΠΈ 0 ΠΈΠ»ΠΈ nan.

16th Nov 2020, 9:11 PM
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская - avatar
6 Answers
+ 5
Ok, here's my solution, I'm using the do...while statement: https://code.sololearn.com/W45ToHTR466g/?ref=app
16th Nov 2020, 9:34 PM
CoffeeByte
CoffeeByte - avatar
16th Nov 2020, 9:45 PM
CoffeeByte
CoffeeByte - avatar
+ 4
I can't open the code, please insert it clicking the insert button.
16th Nov 2020, 9:19 PM
CoffeeByte
CoffeeByte - avatar
16th Nov 2020, 9:23 PM
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская - avatar
+ 1
Thank you, this is what I need. What can you do with the cancel function? If you press it, it counts 0
16th Nov 2020, 9:42 PM
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская - avatar
+ 1
Thanks, I'll try
16th Nov 2020, 9:49 PM
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская
ΠœΠ°Ρ€ΠΈΠ½Π° Гординская - avatar