In how many ways th…
 
Notifications
Clear all

In how many ways the string can be created in JavaScript ?

1 Posts
2 Users
0 Likes
172 Views
0
Topic starter

In how many ways the string can be created in JavaScript ?

1 Answer
0
  1. Using Single or Double Quotes: You can create a string by enclosing characters in either single (') or double (") quotes. For example: 'Hello', "World".

  2. Using Template Literals: Template literals, introduced in ECMAScript 2015 (ES6), allow you to create strings with embedded expressions using backticks (`). For example: `Hello, ${name}!`.

These are the two primary ways to create strings in JavaScript.

Share: