JavaScript Array Methods [map(), flatMap(), filter(), reduce()] #30

preview_player
Показать описание
JavaScript Array Methods [map(), flatMap(), filter(), reduce()] #30

Courses:

HTML:

CSS:

Other videos

► How to Make Animated Portfolio Website Using HTML CSS & JS - Light & Dark Mode Website Tutorial:

► Responsive Personal Portfolio Website using HTML & CSS - How to Make a Website:

► Animated Portfolio Website Template in HTML CSS | Animated Personal Website - Responsive Design:

► How To Make A Website Using HTML CSS Bootstrap - Real Estate Website - Bootstrap Website Design:

► Responsive Ecommerce Website:

►CSS Button Hover Effect:

►CSS Loading Animation:

►Video Background Landing Page:

►Working JavaScript Clock:

►CSS Loading Animation Effects:

Instagram:
Рекомендации по теме
Комментарии
Автор

// map method
let number1 = points.map(myDouble);

console.log('Multiply by 2: ', number1);

function myDouble(value) {
// return value * 2;
return [value, value * 2];
}

//flatMap method
let number2 = points.flatMap(myFunction);

console.log('Multiply by 2: ', number2);

function myFunction(value) {
// return value * 2;
return [value, value * 2];
}


// filter method
let over18 = points.filter(myFunction);

console.log('Greater than 20: ', over18);

function myFunction(value) {
return value > 20;
}

// reduce method
let mySum = points.reduce(myResult);

console.log('Sum of all elements: ', mySum);

function myResult(sum, element) {
return sum + element;
}

webcontent
join shbcf.ru