NODE
node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// flowing words implemented in node.js
(function (string) {
let arr = string.split(' '), bool = true;
for(let i = 1; i < arr.length; i++){
let last = arr[i].at(0), j = i-1
let first = arr[j].at(-1)
if (last != first) bool = false;
}
console.log(bool);
})('This string gets stack') // change this sentence strin>
/* flowing words are words in a sentence where the last
letter of a word is the first letter of the next word */
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run