Substrat en JavaScript à l'aide de la sous-chaîne

const str = "Learning to code";

// substring between index 2 and index 5
console.log(str.substring(2, 5));
// substring between index 0 and index 4
console.log(str.substring(0, 4));

// using substring() method without endIndex
console.log(str.substring(2));
console.log(str.substring(5));
Clumsy Caiman