Write a JavaScript function named "isPowerOfThree" that takes a single parameter (num) and returns a boolean value indicating whether or not the given num is a power of 3. The function should do this by repeatedly dividing num by 3 until either reaching 1 (in which case, num is a power of 3) or a remainder other than 0 (in which case, num is not a power of 3). The function should account for the possibility of the input being 0 or negative, and should return false in those cases.
This prompt doesn't seem malicious.