I am trying to print an upside down right-angled triangle using one for-loop, without the **"\n"** in Javascript.
This is my code:

```js
function triangle(num) {
  triangleStr = "";
  for (let i = num; i > 0; i--) 
  {
    triangleStr += "#";
    console.log(triangleStr);
  }
}
triangle(5);
```