Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What are template literals enclosed by?

View

How do you include variables in template literals?

View

Which of the following is a benefit of template literals?

View

What is the output of the following code: const name = 'Alice'; console.log(Hello, ${name}!);?

View

Can template literals include expressions?

View

What is the result of this expression: const total = 10; console.log(`Total: ${total * 2}`);?

View

Which of the following correctly represents a multi-line string using template literals?

View

Are template literals a replacement for regular string concatenation?

View

Can you perform arithmetic operations inside template literals?

View

What is the result of this expression: const price = 30; console.log(`Price: ${price} USD`);?

View

What are template literals enclosed by?

Single quotes ' '
Double quotes " "
Backticks ` `
Parentheses ()

How do you include variables in template literals?

Using ${} syntax
Using {{}} syntax
Using %% syntax
Using && syntax

Which of the following is a benefit of template literals?

They can create multi-line strings easily
They automatically escape special characters
They can only handle simple string concatenation
They replace arrays with strings

What is the output of the following code: const name = 'Alice'; console.log(Hello, ${name}!);?

Hello, Alice!
Hello, ${name}!
Hello, name!
It throws an error

Can template literals include expressions?

No, they can only include variables
Yes, using ${} syntax
Yes, using # syntax
No, they are strictly for strings

What is the result of this expression: const total = 10; console.log(`Total: ${total * 2}`);?

Total: 10
Total: 20
${total * 2}
It throws an error

Which of the following correctly represents a multi-line string using template literals?

'Line 1 \n Line 2'
"Line 1 \n Line 2"
`Line 1 Line 2`
'Line 1' + 'Line 2'

Are template literals a replacement for regular string concatenation?

Yes, they completely replace the old method
No, they are just an additional option
Yes, but only in ECMAScript 2020
No, they do not support concatenation

Can you perform arithmetic operations inside template literals?

No, only string operations are allowed
Yes, but only addition
Yes, using ${} for embedding expressions
No, template literals are static

What is the result of this expression: const price = 30; console.log(`Price: ${price} USD`);?

Price: 30 USD
Price: 30
USD
It throws an error