Template string can be replaced with regular string literal
2
3export const url = `https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&chart=mostPopular&maxResults=20®ionCode=US&key=${API_KEY}`;
4
5export const searchUrl = `https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&`; 6export const getData = (youRurl) => {
7 const response = fetch(youRurl, {
8 method: 'GET',
Description
Template literals are useful when you need:
Strings that have unescaped double quotes and single quotes.
Strings that need line breaks in them.
If neither of these three conditions is met, you can replace the template expression with a regular string literal.
Bad Practice
const dialogue = `"Journey before destination", said Dalinar.`
const dialogue2 = `What is a 'Kwisatz Haderach'?`
Recommended
const dialogue = '"Journey before destination", said Dalinar.'
const dialogue2 = "What is a 'Kwisatz Haderach'?"
const dialogue3 = `"${getLine()}", said ${getChararcter()}`