const stringIsSubsequence = (first, second) => {
let i = 0;
let j = 0;
while (i < first.length) {
if (j === second.length) {
return false;
}
if (first[i] === second[j]) {
i++;
}
j++;
};
return true;
};
const first = "node.js programming";
const second = "node.js programming language";
console.log(stringIsSubsequence(first, second));
/*
run:
true
*/