Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. Pętla while (dopóki) to kolejny typ pętli, który można spotkać w wielu językach. Struktura tej pętli ma następującą postać: while (wyrażenie_sprawdzające_zakończenie_pętli) { ...fragment kodu który będzie powtarzany...

  2. 19 lip 2009 · str = document.reg; if (str.name.value == "") {. alert("Enter your name"); str.name.focus(); return false; } Validation will working fine if input is empty. Problem. User can enter a blank space on the first.

  3. 8 gru 2022 · Pętla while będzie wykonywać kod w pętli, dopóki warunek jest spełniony. Przykładowo, jeśli chcemy wypisać w konsoli liczby od 1 do 10, to możemy użyć pętli while w następujący sposób: var i = 1; while (i <= 10) { console.log(i); i++; }

  4. The while statement creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.

  5. 21 lut 2024 · W najprostszych słowach, pętla to konstrukcja programistyczna pozwalająca na wielokrotne wykonanie fragmentu kodu. Wyobraź sobie pętlę jako instrukcję dla komputera, która mówi: "Robi to x razy" lub "Kontynuuj robienie tego, dopóki spełniony jest dany warunek". Rodzaje pętli w JavaScript.

  6. Syntax. while (condition) { // code block to be executed. } Example. In the following example, the code in the loop will run, over and over again, as long as a variable (i) is less than 10: Example. while (i < 10) { text += "The number is " + i; i++; } Try it Yourself »

  7. 14 lip 2019 · Pętla while jest podstawową strukturą sterowania w JavaScript, która pozwala na wielokrotne wykonanie bloku kodu dopóki warunek jest spełniony. Jest to bardzo użyteczne narzędzie, gdy potrzebujemy wykonać pewną operację, ale nie wiemy z góry, ile razy będzie musiała być powtórzona.

  1. Ludzie szukają również