How to join text using code?

Hello Velo community!

I have been working on Wix for the past four years. However, this is my very first time using Velo to create a counter that counts up from 0 to the desired number. After scanning the Velo forum, I did manage to create a counter using this code:

$w . onReady ( function () {

let startNum = 0 ;
let endNum = 67 ;
const duration = 25 ;

$w ( “#text1” ). onViewportEnter ( ( event ) => {
let targetId = event . target . id ; // “myElement”
setInterval (()=> {
countUp ();
}, duration );
});

function countUp (){
if ( startNum <= endNum ){
$w ( ‘#text1’ ). text = startNum . toString ();
startNum ++;
}
}

This works very well.

However, I just want to add a simple '+ ’ to the end of the text.

For example, the current text displayed is ’ 67 '. I want it to be ’ 67+

Can someone tell me how to add the + at the end?
Thank you!
(:


P.S. I know this is very basic stuff for y’all but I am completely new to code!

Hi there :wave:t2: You can add text by typing a plus sign then any text you want to add in quotation marks.

$w('#text1').text = startNum.toString() + "+";

Thank you very much!