There is a LIE inside Believe. Programming is all about picking out patterns.
Each letter in a word is numbered from the beginning letter. For a WORD; the numbering goes: 0, 1, 2, 3. The string of letters forms a pattern of numbers. ( we start counting at ZERO )
VAR stringOfLetters = "BELIEVE";
Now, let's pull out the letters starting at the second position to the fifth position and put them in the variable "extractedPattern"::
VAR extractedPattern = stringOfLetters.slice (2, 5);
We use the method SLICE to (literally) slice-out some letters.
var stringOfLetters = "BELIEVE";
var extractedPattern = stringOfLetters.slice(2,5);
document.getElementById("demo").innerHTML = extractedPattern;
This prints out the LIE in BELIEVE.
1 post • Page 1 of 1