Hello
I need some help with Javascript and i m stuck with this simple thing that i m unable to figure out.
i need some help with this....
Suppose i m having two words in an array
array = new Array();
array[0] = "abel";
array[1] = "able";
i need to check if all the letters in the array at position 0 and position 1 are the same... like at pos. 0 the letters in alphabetical order are "a", "b", "e", "l" adn if i can sort the word at pos. 1 in the same order and match it using an IF condition, i will achieve the result.
I want to get something like this
if(array[0] == array[1]){
alert("The word is an anagram");
}
any quick help with idea or code will be appreciated
Thanx



Reply With Quote


Bookmarks