JavaScript FUNCTION EXPRESSIONS in 7 minutes! 🐣
HTML-код
- Опубликовано: 7 сен 2024
- // function expressions = a way to define functions as
// values or variables
// 1. Callbacks in asynchronous operations
// 2. Higher-Order Functions
// 3. Closures
// 4. Event Listeners
const hello = function(){
console.log("Hello");
}
hello();
setTimeout(function() {
console.log("Goodbye");
}, 3000);
// function expressions = a way to define functions as
// values or variables
const numbers = [1, 2, 3, 4, 5, 6];
const squares = numbers.map(function(element){
return Math.pow(element, 2);
});
const cubes = numbers.map(function(element){
return Math.pow(element, 3);
});
const evenNums = numbers.filter(function(element){
return element % 2 === 0;
});
const oddNums = numbers.filter(function(element){
return element % 2 !== 0;
});
const total = numbers.reduce(function(accumulator, element){
return accumulator + element;
});
console.log(total);
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
thanks bro! Can we do a big project to work on with all the things we will have learned? maybe in a week? ( also a normal project is okay. but a bigger one would be better for all of us and i think you would also get more views. also maybe do some shorts on youtube with some tips and tricks to gain subscirbers. thanks ❤
const sayThanks = function () {
console.log("Thank you! Bro Code");
};
sayThanks();
thank you brocode, you are my bro 🌟🌟🌟
channel lives up to its name gg gro
Thank you bro 😎
fire bro
bro please teach us typescript
Django course please