我很难重构代码,有人可以告诉我带参数的void的目的是什么:
case "JAVASCRIPT":
let name= keyObject.customer.name;
let ref = keyObject.customer.ref;
let id1 = keyObject.customer.id1;
let id2 = keyObject.customer.id2;
let secNr= keyObject.customer.secNr;
let key = "";
void(navn + ref + id1 + id2 + secNr + "kijn" + key); // <--- WTF IS THIS...
if (selectedItem.key[0] !== "kunj") {
key = keyObject.keys[0] + "" + keyObject.keys[1];
}
let pathArray = window.location.pathname.split("/");
let returnUrl = pathArray.slice(3).toString().replace(new RegExp(",", "g"), "/");
void(returnUrl); <-- and this
eval(selectedItem.url);
break;
这样重构是否安全:
case "JAVASCRIPT":
eval(selectedItem.url);
break;