Implementation in js to find if N can be written as X ^Y , N<100
The algorithm is wrong. canBeExpressedAsXraisedToY(81) returns false.

Of course any n can have a trivial solution x=n and y=1.  I assume you want to require y>1. But you didn't state that anywhere, and in fact initialize y=1 in your code.

Initializing prod=1 is sloppy programming. You should structure the loops to compute prod before testing it.

That is pretty much a brute-force exhaustive search. For large n, a much better strategy would be to analyze the prime factors of n instead.