Skip to main content
2 of 2
make it more obvious that *s are omitted when j < |n - i|
Neil
  • 177.3k
  • 12
  • 74
  • 281

JavaScript (ES6), 83 bytes

f=
n=>[...Array(n+--n)].map((_,i,a)=>a.map((_,j)=>j<n-i|j<i-n?``:`*`).join` `).join`
`
<input type=number min=1 oninput=o.textContent=f(+this.value)><pre id=o>

Neil
  • 177.3k
  • 12
  • 74
  • 281