Nick Scialli (he/him) Posted on Apr 11, 2020 Roll Your own One-Line Math.average Function Using Array.reduce #webdev #beginners #javascript #tutorial Just a quick example of using array.reduce to roll your own one-liner average calculation! const average = (...nums) => nums.reduce((a, b) => a + b, 0) / nums.length; console.log(average(1, 2, 3, 4)); // 2.5 Enter fullscreen mode Exit fullscreen mode Cheers! Top comments (4) Subscribe Submit Preview Dismiss Collapse Expand Mahesh Sv Mahesh Sv Mahesh Sv Follow I'm Data science Enthusiastic and Tech Geek. I love to be #Dev Location Vijayawada Work Student at Lovely Professional University Joined Jan 2, 2020 • Apr 11 '20 Dropdown menu Copy link Hide This might be irrelevant to the topic. but how you made that cover photo with colorful tab design? Collapse Expand Nick Scialli (he/him) Nick Scialli (he/him) Nick Scialli (he/him) Follow Senior UI engineer at Microsoft. Views here are my own and do not represent the views of my employer. Location Washington, DC Work Senior Software Engineer at Microsoft Joined Feb 8, 2019 • Apr 11 '20 Dropdown menu Copy link Hide carbon.now.sh The theme is Dracula! Collapse Expand Mahesh Sv Mahesh Sv Mahesh Sv Follow I'm Data science Enthusiastic and Tech Geek. I love to be #Dev Location Vijayawada Work Student at Lovely Professional University Joined Jan 2, 2020 • Apr 11 '20 Dropdown menu Copy link Hide thanks Collapse Expand Haikal Azmi Haikal Azmi Haikal Azmi Follow I am here to seek for knowledge, so please give me the power of knowledge! I'm a QA Engineer and a Junior Web Developer Email hycarl.me.study@gmail.com Location Kuala Lumpur, Malaysia Education Computer Science Work Junior Front-End Developer at Kaodim Sdn Bhd Joined Dec 29, 2019 • Apr 12 '20 Dropdown menu Copy link Hide Might be a stupid question, but if I don't want to put it as average calculation, it's still working right for any calculation? Code of Conduct • Report abuse
Top comments (4)
This might be irrelevant to the topic. but how you made that cover photo with colorful tab design?
carbon.now.sh
The theme is Dracula!
thanks
Might be a stupid question, but if I don't want to put it as average calculation, it's still working right for any calculation?