Removing elements form javascript arrays

Method.1 indexOf() and splice()