Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js do while loop

let arr = ['jan', 'feb', 'mar', 'apr', 'may'], i = 0;
// do something at least 1 time even if the condition is false
do{
	console.log(arr[i]);
	i++;
}while(arr.includes('dec'));
// output: jan 
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #loop
ADD COMMENT
Topic
Name
7+7 =