Try wrapping the cases in blocks:
switch(condition) {
case 'complex': {
const query_url = `something`;
… // do something
break;
}
default: {
const query_url = `something`;
… // do something else
break;
}
}
More Related Contents:
- Understanding members of Symbol – function constructor
- Find list of strings that matches a pattern that start with a special character « and end with a special character »
- Javascript object literal: what exactly is {a, b, c}?
- Is it possible to import modules from all files in a directory, using a wildcard?
- Why does babel rewrite imported function call to (0, fn)(…)?
- Call async/await functions in parallel
- How to import jquery using ES6 syntax?
- Spread Syntax ES6
- Async function not returning value, but console.log() does: how to do? [duplicate]
- Using _ (underscore) variable with arrow functions in ES6/Typescript
- When is the body of a Promise executed?
- How can I clone a JavaScript object except for one key?
- How to convert a plain object into an ES6 Map?
- ES6 modules in the browser: Uncaught SyntaxError: Unexpected token import
- ES6 Promises – something like async.each?
- “Uncaught ReferenceError: this is not defined” in class constructor
- Transforming a Javascript iterable into an array
- How to find duplicate values in a JavaScript array of objects, and output only unique values?
- When should I use brackets with imports
- es6 import for side effects meaning
- What is the difference between importing a function expression or a function declaration from a ES6 module?
- Error: How to serialize data from getStaticProps : Next.js
- Update one of the objects in array, in an immutable way
- Access to Script at ‘ from origin ‘null’ has been blocked by CORS policy
- How to namespace es6 classes (for React components)
- JavaScript asynchronous programming: promises vs generators
- How to add mixins to ES6 javascript classes?
- How to understand JS realms
- ES6 arrow function and lexical scope inside a function [duplicate]
- ESLint: “error Parsing error: The keyword ‘const’ is reserved”