Copy a range of characters from a string.

Slice Text

slice_text.js
const start = 0;
const text = "JavaScript";
const part = text.slice(start, start + 4);
const size = part.length;

console.log("start=" + start);
console.log("part=" + part);
console.log("size=" + size);
slice-text `slice(start, end)` copies characters from `start` up to but not including `end`.