whileLoops as long as the condition is true.Syntaxwhile (condition) { }DescriptionWhen the number of repetitions is unknown.ExampleLoading editor…▶ Try it yourselfExpected output0 1 2When to use?Indefinite repetition.Related commandsfor← Range-based for ( : )