In Python, you can do something like this:
string = "Hello World"
print(string[2:5])
# llo
What is the equivalent of that in JavaScript?
In Python, you can do something like this:
string = "Hello World"
print(string[2:5])
# llo
What is the equivalent of that in JavaScript?
You can use both slice or substring:
const str = "Hello world!";
console.log(str.substring(2, 5));
console.log(str.slice(2, 5));