substr(): It takes two arguments, the starting index and number of characters to slice.

PHOTO EMBED

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

Saved by @sreejithbs

let string = 'JavaScript'
console.log(string.substr(4,6))    // Script

let country = 'Finland'
console.log(country.substr(3, 4))   // land
content_copyCOPY

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