Skip to content
Advertisement

Is it possible to unpack values from list to slice?

I’m trying to use values in list to select part of word. Here is working solution:

JavaScript

but I wonder if is it possible to shorten it? Something like this comes to my mind:

JavaScript

It produces:

JavaScript

Advertisement

Answer

You can use the built-in slice (and need to name your list differently to be able to access the built-in):

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