javascript asterisk triangle

enter image description here

Can someone please help me to get this triangle with javascript