How to get the loop to print every line on a text box?

Hello,
I am new to Wix and not a coder either.
I am trying to run a for loop that would print out every count result to a text box with a new line break, but I’m not able to get it done.
below is my code.
I appreciate any help, guidance, or another approach to achieve this.
Thank you.

for (h=6; h>= 0 ; h=h- 1 )
{
var j
for (j= 0 ; j<h; j=j+ 1 )
{
$w( ‘#text135’ ).text = "1 " ;
console.log( “hello” )
}
$w( ‘#text135’ ).text = “\n”
console.log( “hello end” )
}

looking for result
111111
11111
1111
111
11
1

Run this CODE and take a look into CONSOLE.

var fff = "1"

$w.onReady(function () {
    xxx() 
});

function xxx(){
    for (var a = 1; a < 10; a++) {
        let zzz = a/a
        fff = fff+zzz.toString()
        console.log(fff)
    }
}

Or you need something like this one…?

var myValues = ["Hello", "World", "hello", "Velo-Coding"]
var myText = ""

$w.onReady(function () {
    xxx() 
});


function xxx(){
 for (var a = 0; a < myValues.length; a++) {
        myText = myValues[a]+`"\n"`
        console.log(myText)
        $w('#text1').text = $w('#text1').text+myText
    }
}

Do not forget to create a TEXTFIELD with the following ID —> “text1”

Thank you so much for your help russian-dima. I have one more ask, so I modified the script to be below.
However, the result has this “” after every new line. How can I get rid of it ?

export function button4_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
var myText = “”
$w.onReady( function () {
xxx()
});
$w( ‘#text152’ ).text = “”
function xxx(){
for ( var a = 0 ; a < 10 ; a++) {

    myText = (a) + " HAHA"  + ` "\n" `   

    console.log(myText) 

    $w( '#text152' ).text = $w( '#text152' ).text + myText  
} 

}

RESULT

0 HAHA"

“1 HAHA”
“2 HAHA”
“3 HAHA”
“4 HAHA”
“5 HAHA”
“6 HAHA”
“7 HAHA”
“8 HAHA”
“9 HAHA”
"

@tgmvt03
You can also try this one… (another version)

var myValues = ["Hello", "World", "hello", "Velo-Coding"]
var myText = ""

$w.onReady(function () {xxx()});

function xxx(){
 for (var a = 0; a < myValues.length; a++) {
        myText = String(myValues[a]) + "\n"
        $w('#text1').html = $w('#text1').html + String(myValues[a]) + "<br>" 
    }    
}

@russian-dima Thank you the .html worked.

@tgmvt03 :wink: there are always several ways of how to solve a problem.