I have a string that looks like this
test/something/else
My goal is to create two separate variables:
first = test
second = something/else
I attempted to achieve this using the following code snippet:
const [first, ...second] = "test/something/else".split("/");
While the above code successfully assigns the correct value to first, second ends up being an array. Do I need to concatenate the elements in this array to obtain the desired value?