i have this issue in react i have this function but its not right format of react
check(img) {
console.log(img,typeof img)
const url="";
const arrN = ["15","16","35","36","37","38","39","40","n15","n16","n35","n36","n37","n38","n39","n40"];
for (var i = 0; i < arrN.length; i++) {
if (img === arrN[i]) {
url = "/blah/allIcons/blah"+img+"_en.png";
}else{
url = "/blah/allIcons/blah"+img+".png";
}
}
return url;
}
it give me this errror
Module build failed: SyntaxError: "url" is read-only
how i can do it ?