Print bounding box in the terminal
This can be order of magnitudes simpler.  You want a function that takes a width, height, and optional fill character, and returns a string (your box).

Try this:

function box(w, h, fill='░░') {
  const top    = '╔' + '══'.repeat(w-2) + '╗\n' 
  const row    = '║' + fill.repeat(w-2) + '║\n'
  const bottom = '╚' + '══'.repeat(w-2) + '╝'
  return top + row.repeat(h-2) + bottom
}