0
   

While (condition) loop in JavaScript not working fine

 
 
Reply Wed 28 May, 2014 05:38 am
I have i simple piece of code that receives inputs from the user till the user presses zero, but the code receives this zero also, I don't know why here is the code:


var i=0;
var myValues = [];
var InputNumber=prompt("Enter any number, Exit with zero");
InputNumber=parseInt(InputNumber);
myValues [0]=InputNumber;

while (InputNumber != 0)
{
InputNumber=prompt("Enter any number,Exit with zero");
InputNumber=parseInt(InputNumber);
i++;
myValues =InputNumber;
}
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 724 • Replies: 0
No top replies

 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » While (condition) loop in JavaScript not working fine
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/03/2024 at 02:54:24