URL ends with null

Hi,
I have the following code:
let prefixTarget;
if (target === “hebrew”) {
prefixTarget = “https://www.chagim.org.il/”;
}
if (target === “english”) {
prefixTarget = “https://www.eng.chagim.org.il/”;
}
if (target === “spanish”) {
prefixTarget = “https://www.esp.chagim.org.il/”;
}
wixLocation.to(prefixTarget);

Somehow, the url ends with a null in the browser, and looks like this:
https://www.esp.chagim.org.il/null

I’m looking for a way to avoid this null , since it ends with err 404 result.

Will appreciate very much any help!!!
Thanks:)
Dafna