Forloop em JS
for(i = 0; i < x; ++i){
//Loop, x can be replaced with any integer;
}
Repulsive Ratel
for(i = 0; i < x; ++i){
//Loop, x can be replaced with any integer;
}
for (var i = 0; i < 4; i++) {
}
var obj = {a:1, b:2, c:3};
for (var prop in obj) {
console.log("obj." + prop + " = " + obj[prop]);
}
// Output:
// "obj.a = 1"
// "obj.b = 2"
// "obj.c = 3"
for(i=0;i<=5;i++){
console.log(i);}
let array = new Array();
for (let i = 0; i < array.length; i++) {
array.push(i**i);
let tmp = array[i];
console.log(tmp);
};
//multiplying a given number by eight if it is an even number and by nine otherwise.
function simpleMultiplication(number) {
if (number % 2 === 0) {
return number * 8;
} else {
return number * 9;
}
}