The largest integer that can safely be represented in JavaScript is 2^53 - 1 (because that’s the largest safe integer in 64-bit floating-point). Anything larger than that is not guaranteed to be stored precisely. So trying to compare or do arithmetic on numbers larger than that can lead to errors.
3^35 is larger than the largest safe integer. Its actual value is 50031545098999707, but if you evaluate Math.pow(3, 35) in your browser console, it will output 50031545098999704.
Numbers larger than the max safe integer are weird. For instance, if n is one such value, n and n+1 will compare equal.
Exponentiation is also an “implementation-approximated” operation in JavaScript, meaning that different browsers implement it differently. So it is not surprising that Firefox and Chrome give different answers in this case.