UNPKG
@walts81/linq-ts
Version:
latest (1.0.5)
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
Typescript/Javascript LINQ implementation library
github.com/walts81/linq-ts
walts81/linq-ts
@walts81/linq-ts
/
lib
/
average.js
12 lines
(11 loc)
•
312 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
average
=
void
0
;
Array
.
prototype
.
average
= average;
function
average
(
expression
) {
const
length =
this
.
length
;
if
(length ===
0
)
return
0
;
return
this
.
sum
(expression) / length; }
exports
.
average
= average;