Driver code
let n = 3 ; let arr = getRow ( n ) ; for ( let i = 0 ; i < arr . length ; i ++ ) { if ( i == arr . length - 1 ) document . write ( arr [ i ] ) ; else document . write ( arr [ i ] + " " ) ; }