loop in javascript
var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) {
console.log(colors[i]);
}// infinite for loop
for(let i = 1; i > 0; i++) {
// block of code
}var nums = [1, 2, 3, 5];
for (var i = 0; i,nums.length; i++){
console.log(nums[i]);
} var listItem = [
{name: 'myName1', gender: 'male'},
{name: 'myName2', gender: 'female'},
{name: 'myName3', gender: 'male'},
{name: 'myName4', gender: 'female'},
]
for (const iterator of listItem) {
console.log(iterator.name+ ' and '+ iterator.gender);
}for(i=0;i<=5;i++){
console.log(i);}var colors=["red","blue","green"];
for(let color of colors){
console.log(color)
}
Also in JavaScript:
- javascript date countdown
- w3schools json
- capitalize
- angular 6 key value pair getvalue example
- Javascript string compression
- send json post ajax javascript
- password validation with regular expression in javascript
- abstraction in javascript
- radium is not working
- remove object in array javascript
- parsing through json without using key value python
- js is letter
- electron download
- create and append element in javascript
- join array js
- scroll to top in react
- tinymce menubar hide
- install nodejs ubuntu 19.04
- detect a click outside an element javascript
- loopback find or create
- change dxform label angular
- iterate object js
- render image url in react native
- Javascript get text input value