While we are creating a javascript function in OIC Gen 3 version, we have received below error:
the function definition contains unsupported synstax. The output parameter must be named.
The javascript code used:
function replaceString(value, str1,str2){
output = value.replace(new RegExp(str1, "g"), str2)
return output;
}
Solution:
If we declare any variable like output here, we have to also add a var keyword before it.
Modified js code:
function replaceString(value, str1,str2){
var output = value.replace(new RegExp(str1, "g"), str2)
return output;
}
No comments:
Post a Comment