const title = 'curs web practic';
const hasWeb = title.includes('web');
console.log(hasWeb);The “web” sequence exists in title, so the method returns true.
LESSON 33 OF 50
Find out whether a string contains an exact sequence.
String.prototype.includes searches for the supplied text and returns true or false. The search is case-sensitive.
const title = 'curs web practic';
const hasWeb = title.includes('web');
console.log(hasWeb);The “web” sequence exists in title, so the method returns true.
const hasWeb = true;
console.log(hasWeb);The boolean is hard-coded and does not inspect the string.
Check whether title contains “web”, store the result in hasWeb and print it.
Run the code to see the result.The method performs the real search, and the variable stores the boolean result.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.