A Boolean Array Puzzle |  ; Driver code
function changeToZero ( a ) { a [ a [ 1 ] ] = a [ 1 - a [ 1 ] ] ; } let arr ; arr = [ ] ; arr [ 0 ] = 1 ; arr [ 1 ] = 0 ; changeToZero ( arr ) ; document . write ( " " + arr [ 0 ] + " " ) ; document . write ( " " + arr [ 1 ] ) ;