简体   繁体   中英

Reverse XOR operator in JavaScript?

I have 2 variables, x and y .

I am doing z = x^y .

Now assuming I know only z and y , How can I get x back? Is there an opposite to ^ in JavaScript?

是的, ^是它自己的逆。

x == (x^y)^y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM