substring(): It takes two arguments, the starting index and the stopping index but it doesn't include the character at the stopping index.

PHOTO EMBED

Fri Sep 16 2022 09:17:56 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

let string = 'JavaScript'

console.log(string.substring(0,4))     // Java
console.log(string.substring(4,10))    // Script
console.log(string.substring(4))       // Script

let country = 'Finland'

console.log(country.substring(0, 3))   // Fin
console.log(country.substring(3, 7))   // land
console.log(country.substring(3))      // land
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/02_Day_Data_types/02_day_data_types.md