param { Array < number > } . . x param { Array < number > } . . y return { number } function expetation ( [ ... x ] , [ ... y ] ) { let sum = 0 ; if ( x . length == y . length ) { for ( let i = 0 ; i < y . length ; i ++ ) { sum += x [ i ] * y [ i ] ; } } return sum ; } export { expetation } ;