var ourArray = []; var i = 5; do { ourArray.push(i); i++; } while (i < 5); // it will work once and stop looping.