Is there an alternative way rather than to use nested loops? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there an alternative way rather than to use nested loops?

const findSimilerWords = (strArr, input) => { for(let i of strArr){ for (let key in letters){ if (key === i){ input.push(letters[key]); break; } if (letters[key] === i){ input.push(key); break; } } } }

7th Jun 2022, 11:27 PM
Kamogelo Seperepere
Kamogelo Seperepere - avatar
1 Answer
+ 3
Be sure to tag the appropriate programming language. Also, what is the objective of this code?
7th Jun 2022, 11:38 PM
Justice
Justice - avatar