// substring() Method
const str = 'Coding Beauty';
const first3 = str.substring(0, 3);
console.log(first3); // Cod
const first5 = str.substring(0, 5);
console.log(first5); // Codin
const first11 = str.substring(0, 11);
console.log(first11); // Coding Beau
const str = 'Walk the dog';
const first3 = str.slice(0, 3);
const string = "0123456789";
console.log(string.slice(0, 2)); // "01"
console.log(string.slice(0, 8)); // "01234567"
console.log(string.slice(3, 7)); // "3456"
let string = "abcdefghi"
console.log(string.slice(0, 3))
// abc
// slice() Method
const str = 'Coding Beauty';
const first2 = str.slice(0, 2);
console.log(first2); // Co
const first6 = str.slice(0, 6);
console.log(first6); // Coding
const first8 = str.slice(0, 8);
console.log(first8); // Coding B
String.substring(0, 3);
String.substring(0, 10);