In Javascript, can I reverse a boolean as so: boolean = !boolean

Hello, I'm trying to reverse a boolean using `testVar = !testVar;` and it isn't working. Is this possible in UnityScript (Javascript)? If not, is there a somewhat similar way to switch between true or false, or do I have to use an if statement?

Thanks

Yes, but you can't name a variable var. It's a keyword.