I have a variable const that i can’t change the name. i want to be able to do a conditional check and change its value based on the Boolean value of a window.Variable. like code below. any help would be appreciated.
const routes = { () => window.showHide ? routes1 : routes2 }
1
You don’t need the
{}
or the arrow function, it seems like you’re after justconst routes = window.showHide ? routes1 : routes2