whileLoops as long as the condition is true.Syntaxwhile (condition) { }DescriptionUsed when the number of repetitions is unknown. Don't forget to increment.ExampleLoading editor…▶ Try it yourselfExpected output012When to use?Indefinite repetition.Related commandsfor← foreach