شما اینجا هستید

دستور continue میتواند برای از سرگیری حلقه while, do-while, for یا دستور label به کار گرفته شود.

هنگامی که از continue بدون برچسب (label) استفاده میکنیم، تکرار دستورات فعلی درون while, do-while یا for را متوقف و ادامه اجرای حلقه را با تکرار بعدی آغاز میکند. در تضاد با دستور break, دستور continue اجرای حلقه را به طور کامل متوقف نمیکند. مثلا در حلقه while، به قبل از شرط پرش میکند و در حلقه for، به دستور افزایش شمارنده حلقه پرش میکند.

هنگامی که از continue به همراه label (برچسب) استفاده میکنیم به دستوراتی که با این برچسب نشانه گذاری شده اند پرش میکند.

سینتکس دستور continue مانند نمونه های زیر است.

continue;

continue label;

 

مثال 1

 

مثال زیر یک حلقه while با دستور continue که در هنگام برابر شدن مقدار متغیر i با عدد سه، اجرا میگردد را نمایش میدهد.

i = 0;
n = 0;
while (i < 5) {
  i++;
  if (i == 3) {
    continue;
  }
  n += i;
}

مثال 2

برچسب checkiandj که شامل برچسب checkj است را در نظر بگیرید. اگر برنامه با continue مواجه شود،حلقه را در تکرار فعلی checkj متوقف و از تکرار بعدی از سر میگیرد. هر وقت با continue مواجه میگردد،‌ تا هنگامی که شرط مقدار false را برگرداند checkj دوباره تکرار میشود. هنگامی که false بازگردانده میشود،‌ بقیه دستورات checkiandj کامل میگردد و checkiandj تا هنگامی که شرط false را برمیگرداند تکرار میگردد. هنگامی که false برگردانده شود، برنامه از بعد از دستورات checkiandj ادامه پیدا میکند.

نکته : اگر continue دارای برچسب checkiandj بود، برنامه از بالای دستورات checkiandj ادامه پیدا میکرد.


 
checkiandj:
  while (i < 4) {
    console.log(i);
    i += 1;
    checkj:
      while (j > 4) {
        console.log(j);
        j -= 1;
        if ((j % 2) == 0) {
          continue checkj;
        }
        console.log(j + " is odd.");
      }
      console.log("i = " + i);
      console.log("j = " + j);
  }

 

دیدگاه‌ها

Viagra Alcool Tabac http://abcialisnews.com - Buy Cialis Cytotec Sans Ordonnance Pharmacie Cialis Zentel Without Rx With Overnight Delivery

Prezzo Di Cialis 5 Mg http://buyciallisonline.com/#556 - Buy Cialis Cialis Comprar Generico Cialis Buy Real Zithromax

Cash On Delivery Levaquin http://buycialisuss.com - cialis online Msc Propecia Cialis Cialis Or Viagra

buy cialis without a prescription http://cialislet.com/

what would happen if a girl took cialis https://wisig.org/

how to pay student loans quick quick loans online quick loans quick approval personal loans $1500 quick cash loans today

quick cash loans no credit check reviews quick pay payday loans new york state threatens to garnish quick loan quick cash loans roseburg or quick loans 100% approval

quick payday loans two notch rd quick loans deposit same day quick loans how quick does sallie mae report loans paid off quick online loans

quick business loans for startup quick cash loans reviews quick loans online quick cash loans personal loans quick

https://paydailoanz.com/# - quick loan

quick same day payday loans quick cash loans tulsa ok quick loan quick and loans rates quick and loans rates

quick funding loans freedom card quick and loans rates quick loan quick small loans online quick loans online direct deposit

https://paydailoanz.com/# - quick loans

how much is hydroxychloroquine https://webbfenix.com/

hobbies that make money make money on the side make money ways to make money from home make money taking surveys

make money at home how to make money on the side make money how much money can i make on social security apps to make money

https://make-money-blogs.com/# - work from home

best ed pills over the counter http://www.cialij.com/

januvia prices in mexico http://lm360.us/

how to make money on amazon make money blogging work from home how to make money on instagram how did jeffrey epstein make his money

how to make money as a teen how much money do youtubers make make money imgclick will easily make money sharing photos friends social free file upload free ways to make money online

https://make-money-blogs.com/# - work from home

make money online fast how much money can i make on social security make money how to make easy money make money online from home

how to make money with a website ways to make money at home make money woodworking ideas to make money how to make extra money

https://make-money-blogs.com/# - work from home

buy chloroquine online https://chloroquine1st.com/

how to make money on facebook make money on the side make money how does robinhood make money how to make money on instagram

how did george soros make his money how to make money on the internet make money free ways to make money online legit ways to make money online

https://make-money-blogs.com/# - work from home

cipro without a doctor prescription ciprofloxacin cost ciproxin [url=https://ciprofloxacin.confrancisyalgomas.com/#]ciprofloxacin cost walmart[/url] https://ciprofloxacin.confrancisyalgomas.com/

how to make money make money online free work from home how to make money on the internet make money now instant payout

ways to make money on the side how to make easy money make money how to make money online for free make money blogging

https://make-money-blogs.com/# - work from home

how did jerry jones make his money how to make easy money work from home make money fast how to make money online for free

make money from home make money online fast work from home how did tom steyer make his money how to make money on twitch

https://galogimed.ru/ - make money

make real money online how to make money on twitch make money how to make money online for free best way to make money online

how much money can you make on youtube legit ways to make money online work from home how can i make money make money on facebook

http://vozdushniy-express.ru/ - make money

cheap viagra fast delivery https://viatribuy.com/

make money on youtube best ways to make money online make money how much money can i make on social security how to make money with youtube

quick ways to make money diy crafts that make money make money how to make money online for free how did mark cuban make his money

http://mcgrating.ru/ - work from home

cbd https://cbdoilwalmart.com/ - cbd cream cbd cbd

buy cialis online http://cialisoni.com/

Hi! puyapardaz.ir cialis anwendung wirkungcialis bathtubs wtf buy cialis 20mg in australia when does cialis become genericgeneric cialis india pharmacy buy cialis online in pakistan

افزودن دیدگاه جدید

دیدگاه

  • تگ‌های HTML مجاز: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.

Plain text

  • تگ‌های HTML مجاز نیستند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
كد امنيتي
این پرسش برای جلوگیری از ارسال اسپمهای اتوماتیک است.