Count Backwards With a For Loop
var myArray = [];
for (var i = 9; i > 0; i -= 2){
myArray.push(i);
}
console.log(myArray); // console output [ 9, 7, 5, 3, 1 ]<?php
// a array
$weekday = array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday", "Sunday");
// the for loop
for($i = 6; $i >= 0; $i = $i -1){
print ( "$weekday[$i]<br>" );
}
?>
Also in JavaScript:
- javascript array pop
- UTL ,Raw json
- convertir seconde
- JS date year
- await async sleep
- pushing to an array
- jquery trigger change event
- shuffle an array of numbers in javascript
- js first letter uppercase
- express get full url
- callout react
- jquery populate form json
- what is ajax
- digitally signed react native
- knex insert multiple rows
- vuex-module-decorators nuxt axios
- int val javascript
- loopback model count
- javascript check if is array
- javascript remove scientific notation
- how to check if a key exists in an object javascript
- javascript get array difference
- nodejs add to array
- angular themeable components