export function product(...xs: number[]): number {
  var a = 1;
  for (var x of xs)
    a *= x;
  return a;