코딩일상

reduce 함수?? 콜백 ?? (콜백은 아직 완전히 이해하지 못함..) 본문

개발 공부/JavaScript

reduce 함수?? 콜백 ?? (콜백은 아직 완전히 이해하지 못함..)

solutionMan 2022. 7. 15. 21:29
반응형

 

reduce함수에대해 깔끔하게 가장 잘 정리 한것같은 이미지를 첨부하며

같이 보며 좋은 레퍼런스들을 첨부하였다.

 

[1,2,3,4,].reduce(function (a, b) {return a * b},10)

 

 


레퍼런스

Reduce에 관한것 

 

 

Array.prototype.reduce() - JavaScript | MDN

reduce() 메서드는 배열의 각 요소에 대해 주어진 리듀서(reducer) 함수를 실행하고, 하나의 결과값을 반환합니다.

developer.mozilla.org

 

 

[JS] 자바스크립트 배열의 합계, 평균 구하기

📌 배열의 합계, 평균 구하기 자바스크립트에서 배열의 합계와 평균을 구하는 방법으로 reduce( )를 사용하면 된다. 또한, 배열의 역순으로 연산을 원할 때는 reduceRight( )를 사용하면 된다. 1️⃣

cocobi.tistory.com

 


 

 

 

레퍼런스

call back에 관한것  

 

 

Callback function - MDN Web Docs Glossary: Definitions of Web-related terms | MDN

A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

developer.mozilla.org

반응형
Comments