Pregunta de entrevista de Jio

Center a div in different ways javascript problem solving question flatten an array