Watch me learn web dev.JavaScript: Confirm the ending

Опубликовано: 27 Июль 2026
на канале: TippingTheIceberg
9
0

Today we tried to look to see if the target is in a word. We used a slice method to see if the part removed is the target. The values of the slice was figured out by modifying the method of getting the last letter of a string, .length - 1, but instead of 1 we use the target.length as the values we need to go back to. Then the second value will just be whatever the length of the word is, to cut it all out. If the part removed matches the target, then a true statement is returned.