<html>
<body>
<h1>JavaScript Strings</h1>
<h2>The slice() Method</h2>
<p>Extract a part of a string and return the extracted parts in a new string:</p>
<p id="demo"></p>
<script>
let text = "Apple, Banana, Kiwi";
let part = text.slice(-12, -6)
document.getElementById("demo").innerHTML = part;
</script>
</body>
<!-- /js/tryit.asp?filename=tryjs_string_slice_negative Thu, 06 Feb 2025 19:15:23 GMT -->
</html>