Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Math.avg

Math.avg = (...numbers) => {
    let x = 0
    numbers.forEach(item => {
        x += item
    })
    return x / numbers.length
}

// Usage
console.log(Math.avg(10, 20, 30))
Comment

PREVIOUS NEXT
Code Example
Javascript :: Check for mobile device 
Javascript :: hex decima to binary js 
Javascript :: javascript on scroll change nav color 
Javascript :: formik seterrors 
Javascript :: add to a list mongoose 
Javascript :: today date selected in datepicker 
Javascript :: javascript async/await 
Javascript :: Javascript - find the largest 
Javascript :: js check collision 
Javascript :: nodejs write to log file 
Javascript :: break in map javascript 
Javascript :: black adam release date 
Javascript :: js set iframe code 
Javascript :: settimeout method 
Javascript :: array of array key value javascript 
Javascript :: SHOPIFY LANGUAGE SELECTOR 
Javascript :: regex to escape special characters 
Javascript :: vue dynamic routes with parameters 
Javascript :: linear gradient react native 
Javascript :: javascript html video seek to time 
Javascript :: how to manage logging using winston for production and development in node js "github" 
Javascript :: fs.appendFileSync in nodejs 
Javascript :: trim text after a certain word in js 
Javascript :: group by in javascript 
Javascript :: get main tr from td jquery 
Javascript :: map keys to list node js 
Javascript :: componentwillunmount hooks 
Javascript :: datepicker react native 
Javascript :: dummy data json 
Javascript :: javascript datatypes 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =