Fibonacci problem ( Value of Fib ( N ) * Fib ( N ) | Javascript implementation of the approach ; Driver code
function getResult ( n ) { if ( ( n & 1 ) > 0 ) return 1 ; return - 1 ; } let n = 3 ; document . write ( getResult ( n ) ) ;