Skip to content

cotrWhileLoop

Creates a while loop

Aliases:

  • cotrWhileLoop
  • whileLoop
  • whileTrue

cpp

while (condition) {
// Your code here
}

csharp

while (condition) {
// Your code here
}

dart

while (condition) {
// Your code here
}

go

for condition {
// Your code here
}

haskell

-- Haskell does not have a traditional while loop. Use recursion or higher-order functions like 'until'.

java

while (condition) {
// Your code here
}

javascript

while (condition) {
// Your code here
}

javascriptreact

while (condition) {
// Your code here
}

kotlin

while (condition) {
// Your code here
}

perl

while (condition) {
# Your code here
}

php

while condition) {
// Your code here
}

powershell

Terminal window
while (condition) {
# Your code here
}

python

while condition:
# Your code here

r

while (condition) {
# Your code here
}

ruby

while condition do
# Your code here
end

rust

while condition {
// Your code here
}

scala

while (condition) {
// Your code here
}

shellscript

Terminal window
while [ condition ]; do
// Your code here
done

swift

while condition {
// Your code here
}

typescript

while (condition) {
// Your code here
}

typescriptreact

while (condition) {
// Your code here
}