function broadcastSizes (...sizes) {
  const dimensions = sizes.map((s) => s.length)
  const N = Math.max(...dimensions)
  const sizeMax = new Array(N).fill(null)
  // check for every size
  for (let i = 0; i < sizes.length; i++) {
    const size = sizes[i]
    const dim = dimensions[i]
    for (let j = 0; j < dim; j++) {
      const n = N - dim + j
      if (size[j] > sizeMax[n]) {
        sizeMax[n] = size[j]
      }
    }
  }
  for (let i = 0; i < sizes.length; i++) {
    checkBroadcastingRules(sizes[i], sizeMax)
  }
  return sizeMax
}
Receives two or more sizes and gets the broadcasted size for both.
@param  {...number[]} sizes Sizes to broadcast together
@returns {number[]} The broadcasted size