<script> a = 3; a = a^a // a = 27 </script>
there is something like this:
Math.pow :
var a = 3; a = Math.pow(a, a);
// You can pass '3^3' to a method if you like- Math.toPow= function(s){ s= s.split('^'); return Math.pow(+s[0], +s[1]); } // or to validate input- Math.toPow= function(s){ s= s.split('^'); try{ return Math.pow(+s[0], +s[1]); } catch(er){ return NaN; } } Math.toPow('3^3') /* returned value: (Number) 27 */ // I prefer to use Math.pow(3,3) Math.pow(3,3) /* returned value: (Number) 27 */
^ called XOR.
http://en.wikipedia.org/wiki/Exclusive_or
Source: https://habr.com/ru/post/1763220/More articles:Programmatically add reminder to Android calendar? - androidAlarmManager at specific dates and times - androidthe array has the same type, and the linked list has a different type - cFile Storage - databaseRegular expressions match any string between [and] - c #Acts like Taggable On: translate tags - ruby-on-railsWPF style trigger problem - wpfCreate a list of colors, blue to red, from 0% to 100% - language-agnosticSubmit and upload drops using the same URL - google-app-engineHiding get variables - jqueryAll Articles