Build a String Inspector - Step 10

Tell us what’s happening:

I have tried the Read-Search-Ask method

I have searched for similar questions that have already been answered on the forum

Your code so far


// User Editable Region

c// Part 1: includes() method
const fccSentence = "freeCodeCamp is a great place to learn web development.";

console.log("Here are some examples of the includes() method:");

const hasFreeCodeCamp = fccSentence.includes("freeCodeCamp");
console.log(`fccSentence.includes("freeCodeCamp") returns ${hasFreeCodeCamp} because the word "freeCodeCamp" is in the sentence.`);

const hasJavaScript = fccSentence.includes("JavaScript");
console.log(`fccSentence.includes("JavaScript") returns ${hasJavaScript} because the word "JavaScript" is not in the sentence.`);

const hasLowercaseFCC = fccSentence.includes("freecodecamp");
console.log(`fccSentence.includes("freecodecamp") returns ${hasLowercaseFCC} because includes is case-sensitive.`);

// Part 2: slice() method
const message = "Welcome to freeCodeCamp!";

console.log("Here are some examples of the slice() method:");

// Extract "freeCodeCamp" from the message
const platform = message.slice(11, 23);
console.log(`The word "${platform}" was sliced from the message.`);

// Extract the first word "Welcome" from the message
let greetingWord = message.slice(0, 7);
console.log(`The first word is "${greetingWord}".`);



// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build a String Inspector - Step 10

hello @vemulanamithareddy , welcome to the forum!

Please remove the “c” before the comment and try again.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.