Jio interview question

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