Funktion JavaScript deklarieren
function myFunction(var1, var2) {
return var1 * var2;
}
Wrong Willet
function myFunction(var1, var2) {
return var1 * var2;
}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
var x = myFunction(10, 10); // Function is called, return value will end up in x
function myFunction(a, b) {
return a * b; // Function returns the product of a and b
}
$('a.button').click(function(){
if (condition == 'true'){
function1(someVariable, function() {
function2(someOtherVariable);
});
}
else {
doThis(someVariable);
}
});
function function1(param, callback) {
...do stuff
callback();
}
let x = function (num) { return num * num };
console.log(x(4));
function toCelsius(fahrenheit) {
return (5/9) * (fahrenheit-32);
}