Update index.js

Splice too much？
Merge pull request #511 from zxc122333/patch-1

Fix splicing error in Observer