Flag, Is It Always Efficient?
//variables int value; int numOfValue = 0; int sum = 0; int stop = 100; int flag = 1; //first code with flag do { if (sum <= 100 && flag == 1 ) { Console.Write("Enter the value: "); value = Convert.ToInt32(Console....
Search for a command to run...
//variables int value; int numOfValue = 0; int sum = 0; int stop = 100; int flag = 1; //first code with flag do { if (sum <= 100 && flag == 1 ) { Console.Write("Enter the value: "); value = Convert.ToInt32(Console....
const number = Number(prompt('How many people?')); if(number){ } When the user clicks "Cancel" in prompt(), it returns null. Since Number(null) results in 0, number is set to 0. This behaviour can be observed directly in the console. Before understa...
<Error code> const onClickButton = () => { if(!word || (newWord.length === 3 || word[word.length - 1] === newWord[0])){ // ...code } }; In this function, the first condition checks for newWord.length === 3. However, even if newWo...
<작성 코드> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>쿵쿵따 게임</title> </head> <body> <div>쿵쿵따 게임</div> <div><span id="order">1</span>번째 참가자</div> <d...