String Methods in ES6
- String.includes()
The includes() method returns true if a string contains a specified value, otherwise false:
- String.startsWith()
The startsWith() method returns true if a string begins with a specified value, otherwise false:
- String.endsWith()
The endsWith() method returns true if a string ends with a specified value, otherwise false:
let text = “Hello guys, welcome to my tutorial.”;
text.includes(“guys”)
text.startsWith(“Hello”)
text.endsWith(“tutorial “)
The For/Of Loop
The JavaScript for/of
statement loops through the values of an iterable objects.
let marks = [80, 90, 70];
for (let mark of marks) {
console.log(score);
}
Well Explained
Well Explained
Well Explained