Look at the last line:
Such extend / assignIn usage modifies the first argument:
So the globalPriceFormat global price format becomes polluted with a random local format value,
globalPriceFormat
format
See also:
groupLength
Magento_Catalog/js/price-utils