Could there be an error in Example 1? getOppositeOrientation() uses the line screen.orientation.startsWith("portrait") as if screen.orientation returns a string, when it actually returns an object with the type (so the command worked for me if i wrote screen.orientation.type.startsWith("portrait"). I would appreciate guidance on this matter if I'm wrong.
Could there be an error in Example 1?
getOppositeOrientation()
uses the linescreen.orientation.startsWith("portrait")
as if screen.orientation returns a string, when it actually returns an object with the type (so the command worked for me if i wrotescreen.orientation.type.startsWith("portrait")
. I would appreciate guidance on this matter if I'm wrong.