
He is member of IFX forum,Oracle JCP and participant in Java Community Process. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). The output in the browser console will be as below:Įxample for slice with Negative Index īhagvan Kommadi is the Founder of Architect Corner & has around 20 years’ experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. You can execute the code above in a browser that supports javascript. You can see the code below demonstrating the example.Įxample for slice with Negative Index const books = The last element is -1 and -2 will be the second last element. Now let us look at the slice method with the start parameter value negative.

Slice method example function sliceExample() Ģ.6 JavaScript slice() With Negative index
