JavaScript string formatting inspired by Python’s `str.format()`