My function works as I expect (I think) but I want to change my loops with higher order functions, but I'm struggling a bit..
Here is my code :
const getKeywords = (str) => {
var i, j, result = [];
for (i = 0; i < str.length; i++) {
for (j = i + 1; j < str.length + 1; j++) {
result.push(str.slice(i, j).toLowerCase());
}
}
return result;
}
console.log(getKeywords("testing my function"))
If someone has an idea of which Higher Order Functions to use to replace my nested loop thank you :)