29.3k views
0 votes
Slicing can best be described as

1). Assigning a value to a variable
2). Combining two or more strings to form one big string
3). Pulling out one specific character from a string
4). Pulling out groups of characters from a string

User Ribeiro
by
8.3k points

2 Answers

7 votes

Your Answer Is...

⭐️D) pulling out groups of characters from a string⭐️

You will be a fantastic programmer one day!

-Kaila

User Geovanna
by
7.8k points
5 votes

Answer:

Option 4 : Pulling out groups of characters from a string.

Step-by-step explanation:

  • Slicing can be defined as choosing a specific part from the string and presenting it another string.
  • Hence slicing() is a method used to extract required parts from the string.
  • Syntax for method slice() is as follows:

string.slice(start, end)

  • Where start and end are parameters for determining the part of the string to be extracted. These parameters work as an index to actual string.

For example:

Extract the characters from position 3 to 8:

var str = "Hello world!";

var res = str.slice(3, 8);

User Aeldron
by
8.9k points