a JS novice ~ simply looking to pass in a value from Jenkins into a pipeline script that is then converted to an Int.
pipeline snippet
parameters {
string(name: 'TIMES_TO_LOOP', defaultValue: ['1'], description: 'Number of times to loop')
javascript snippet*
let timesToLoopThrough = 1; //set a default value
timesToLoopThrough = timesToLoopThrough.parseInt(agreementsToGenerate); //reset to value passed in
//use timesToLoopThrough in subsequent code
error
TypeError: timesToLoopThrough.parseInt is not a function