export function sum ( arr ) { return arr . reduce ( ( acc , curr ) => acc + curr , 0 ) ; } export function inherit ( ) { Array . prototype . sum = function ( ) : number { return sum ( this ) ; } ; } export default sum ;