Skip to content

Commit db9fd60

Browse files
authoredSep 25, 2023
ADD[238]: while loop example section to basic-concept.groovy (#299)
2 parents 78ba770 + cef67ba commit db9fd60

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎topics/groovy/helloworld/basic-concept.groovy

100644100755
+12
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,15 @@ try {
135135
} catch (Exception e) {
136136
println("An exception occurred: ${e.message}")
137137
}
138+
139+
//--------------------
140+
// Working with while loop
141+
//--------------------
142+
143+
consoleLog("Working with while loop")
144+
145+
def counter = 0
146+
while (counter < 10) {
147+
println("The counter is $counter")
148+
counter++
149+
}

0 commit comments

Comments
 (0)
Please sign in to comment.