Skip to content
Advertisement

How do you extract till the second last element from each sub-list in a nested list?

How do you extract till the second last element from each sub-list in a nested list?

JavaScript

The desired output is:

JavaScript

Advertisement

Answer

You can use the following method to do this:

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement