I have the following code and I get the error \'Duplicate Declaration query_url\'.
switch(condition) { case \'complex\': const query_url = `somet
Just put your switch in a function with some return statements :
switch
var condition; function aSwitch(condition){ switch(condition) { case 'complex': return 'something'; default: return 'something'; } } const query_url = aSwitch(condition);