Convert a number to a string with toString() js function Invalid token

Hi there,

I try to use the toString() javascript function with ui.vision like this :

{
“Command”: “executeScript_Sandbox”,
“Target”: “var day = new Date(); day = ((day.getDate())<10)?‘0’+(day.getDate()):(day.getDate()); return day;”,
“Value”: “day”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var debutD = new Date(); debutD = ${day}-(Math.floor(Math.random()*(${day}-1+2)+2)); return debutD;”,
“Value”: “debutD”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “var jour=${debutD}.toString(); return jour;”,
“Value”: “jour”
}

But I have an error : “Error in executeScript_Sandbox code: Invalid or unexpected token”

How can I do this without error ?

Thanks in advanced

EDIT : I have finally found the solution :

{
“Command”: “executeScript_Sandbox”,
“Target”: “var jour=${debutD}; jour=jour.toString(); return jour;”,
“Value”: “jour”
}

Have a good day