Add .idea to .gitignore

.idea is used by all IDEs produced by JetBrains
Fix syntax error and improve code

Remove semicolon at the end of arrayClickHandler function since it is
not needed.
Inside of arrayClickHanlder only the swapIndex's font needs to be reset,
it not necessary to pass both the current index and the swapIndex