int to string and string to int

Hello,

I’m a game to make it, I see those containing variables below,
var score = 0;
var scorestring = “”

‘Score’ is an int variable and ‘scorestring’ is a string variable, I would like to ‘scorestring’ variable is the same as the ‘score’ variable, I want than an update feature set ‘scorestring’ = score’ but it can not because you do not just an int variable to a string variable can go, how do I do this?

I already found a code to do the opposite, (string to int)

var scorestring = "10";
var score = parseInt(scorestring);

I programming in JavaScript. I hope it is understandable because I have this text translated by Google Translate.

Tim Visée :wink:

the magic to string is always the same

.ToString(); :wink:

Huh? Please give an example …

scorestring = score.ToString();

Thanks!
Problem is solved,


Variables

score       (int varable)
scorestring (string variable)

int to string script

scorestring = score.ToString();

string to int script

var scorestring = "10";
var score = parseInt(scorestring);