- Initialize - a count variable is initialize, it's usually zero but it doesn't have to be
- Test - A test to see if the loop should continue
- Increment - finally the count is incremented, it doesn't have to be an increment it could be decrements as well
Let's use the JavaScript code to demonstrate:
If you execute the loop below you will bet a for loop that executes when i is less than 10
for (var i = 0; i < 10; i++)
{
console.log("i is " + i);
}
console.log("i outside of for look is " + i);
Here is the output:
Noticed the number outside of the loop is bigger than the number that's inside the loop on the last execution. Just keep that in mind when you are working with a for loop. If you want to execute on the tenth loop you have to change your test condition to say i <= 10. This implies that i has to be less than or equal to 10 before the loop stops executing
Here is the output:
Although the value outside of the loop is now 11!
Sobat CUAN, setuju gak sih kalau untuk menjalankan aktivitas sehari-hari sebagai online seller dengan lancar, kamu membutuhkan perangkat atau aplikasi pendukung yang bisa mempermudah pekerjaanmu?
ReplyDeleteDengan adanya aplikasi pendukung, tentunya kamu akan lebih bisa menerapkan sosial media dan digital marketing dengan lebih tepat sasaran. Berikut ini adalah 4 aplikasi pendukung aktivitas bisnis online yang sedang kamu jalankan.
Sobat CUAN sudah installed yang mana? Share di kolom komentar ya!
#hidupcuan #milenialkayadanmandiri #olshopindonesia #olshopindo #reseller #olshopjakarta #marketplace #tokopedia #mulaidarisekarang #mulaidarisini #jualanonlineshop #suksesjualanonline #socialmediamarketing #digitalmarketing
to know more:https://hidupcuan.com/