This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JavaScript Strings

The slice() Method

Extract a part of a string and return the extracted parts in a new string:

let text = "Apple, Banana, Kiwi";
let part = text.slice(-12,-6);
document.getElementById("demo").innerHTML = part;