how to calculate average of array in javascript
const arrAvg = arr => arr.reduce((a,b) => a + b, 0) / arr.lengthconst average = (...args) => args.reduce((a, b) => a + b) / args.length;
// Example
average(1, 2, 3, 4); // 2.5
Also in JavaScript:
- profile Image Picture Preview
- js math random
- qr code generator with javascript
- jquery prevent form submit
- asynchronous javascript
- jquery ajax post example
- info
- hwo to cehck req header in js
- what are callbacks
- javascript randint
- add 10 seconds to date javascript
- crypto nodejs
- show hide more text jquery
- how to block special characters in javascript
- js regex password
- how to generate random text in vue js
- push object into array javascript
- how to get data send from a form express
- how to check has class name in js?
- javascript add value to input
- .on change get value
- jquery AND operation
- how to add two numbers in javascript
- créer composant react