JSFiddle - React, Tailwind, and code Playground
by akang2
HTML
geekwise javascript day 2
JavaScript
for(i = 0; i <= 100; i+=5) {
console.log(i);
}
//functions
//this is how you declare a function
function foo() {
console.log("hello..");
}
//this is how you call that function
foo();
//this is how you give it a parameter
function loo(x) {
console.log("hello " + x );
}
//this is how you call it with a parameter
loo("to your mom");
//example of a function with a parameter 'x'
function square(x) {
console.log( x * x );
}
square(34);
//return value. don't use a word when you're defining it. it's like an expression by itself
function square(x) {
return x * x;
}
var y = square(4) + 2;
console.log(y);
//console.log(square ( square (y) );