Delete vs Splice in javscript