Define a function that accepts a sentence string and two words as args. The function should return a boolean indicating if the sentence includes either word.
Identify a pair of mutually exclusive conditions
Given a for loop, translate it into a while loop, and vice-versa
function aCounter(word) {
let index = 0;
let count = 0;
while (index < word.length) {
let char = word[index];
if (char === "a" || char === "A") {
count += 1;
}
index++;
}
return count;
}
function aCounter(word) {
word = word.toLowerCase();
let count = 0;
for (var i = 0; i < word.length; i++) {
if (word[i] === "a") {
count++;
le;
}
}
return count;
}
Write a function that iterates through a provided string argument
Given a description of pig latin, write a function that takes in a string argument and utilizes String#slice to translate the string into pig latin.
Write a function that takes in an array of words and a string as arguments and returns a boolean indicating whether the string is located inside of the array. The function must use Array.indexOf().
Define that an array literal is an ordered list of values defined by using bracket and individual values are read by indexing.
Arrays are zero-indexed.
In the above list, Reference, Syntax, and Type are seen most frequently.