Hello everyone ! So I am learning javaScript, it’s been tough to be honest, I can’t exactly understand how to start, and like are there definite rules in javascript to follow?
I am trying to solve this exercise, but I’m a bit confused what exactly should I do ?

first, I woulf say, figure out the steps, how would you solve it with pen and paper?
once you have a process that can give the correct answer with any pair of words, then think of how to translate that in javascript
That’s so true, that’s why I feel like JavaScript requires critical and analysis thinking as much as it needs technical skills
I am trying , thank you for replying : )
To give some hints which methods would be useful here:
split()
sort()
either a for loop or array methods like map or forEach
To add to the list of hints
filter( )
indexOf( )
and tenary operator in addition to what @jsdisco has mentioned above.
But above all try to understand the problem, and you will eventually figure it out
Very Helpful hints @jsdisco , Thank you so much 
@OnazOnaz I’ve actually never heard of them before !! Thank you for introducing them to me 
