Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Early return mdn

function counter() {
  for (var count = 1; ; count++) {  // infinite loop
    console.log(count + 'A'); // until 5
      if (count === 5) {
        return;
      }
      console.log(count + 'B');  // until 4
    }
  console.log(count + 'C');  // never appears
}

counter();

// Output:
// 1A
// 1B
// 2A
// 2B
// 3A
// 3B
// 4A
// 4B
// 5A
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native onrefresh stuck release 
Javascript :: javascript check if json object is valid 
Javascript :: javascript moving text from left to right onscroll 
Javascript :: angular key value pipe compareFn example 
Javascript :: how to write to and read from text files line by line using javascript 
Javascript :: npm i react-router semantic-ui-react semantic-ui-css 
Javascript :: how to console.log while using a prompt in javascript 
Javascript :: angular chart js Doughnut colors 
Javascript :: angular error ng0303 ngForIn 
Javascript :: array of alphabets 
Javascript :: javascript asdyn function 
Javascript :: jsrender get index 
Javascript :: express react docker container example 
Javascript :: Instar y crear proyecto AdonisJS 
Javascript :: how to call javascript function in html using thymeleaf and put argumnet as method arg 
Javascript :: nsenter 
Javascript :: node-google-spreadsheet color border 
Javascript :: asdasd junsd js 
Javascript :: package.json files property local 
Javascript :: puppeteer open browser authentication facebook 
Javascript :: functional not if then else 
Javascript :: upload blob to server 
Javascript :: sample of jstree ajax call code farm 
Javascript :: do nonmetals lose electrons 
Javascript :: train function ajax 
Javascript :: cypress graphql request example 
Javascript :: arrow function component react shortcut vscode 
Javascript :: dragula filter 
Javascript :: coment executer des touche de clavier avec du js 
Javascript :: set up background process in express app 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =