The awards desk needs a readable caption and a quick check for a word in the original text. Work in script.js and inspect the Console; there are no page elements to edit.
Strings are values with built-in helper methods. This lesson keeps the practice focused on one transformation and one membership check.
A string has numbered character positions starting at 0. slice(start, end) includes the character at start and stops before end.
const trailName = "river loop";
console.log(trailName.toUpperCase());
console.log(trailName.includes("loop"));
slice() also returns a new string; it does not change the original. Try "STARLINE".slice(1, 5) in the Console to check the diagram. The task below practices two other methods.
upperPhrase from phrase with toUpperCase(); inspect the supplied uppercase checkpoint.hasWorld from phrase with includes("world"); inspect the supplied membership checkpoint.HELLO WORLD | true line using the computed values.Use toUpperCase() to create the uppercase version.
Use includes() to check whether the original string contains world.