SyntaxFix
Write A Post
Hire A Developer
Questions
Use the splice method.
(At least I assume that is the answer, you say you have an object, but the code you give just creates two variables, and there is no sign of how the Array is created)