Nth XOR Fibonacci number | Function to return the nth XOR Fibonacci number ; Driver code
function nthXorFib ( n , a , b ) { if ( n == 0 ) return a ; if ( n == 1 ) return b ; if ( n == 2 ) return ( a ^ b ) ; return nthXorFib ( n % 3 , a , b ) ; } let a = 1 , b = 2 , n = 10 ; document . write ( nthXorFib ( n , a , b ) ) ;