zheka79,
const Obj =
{
"table":"orderBook",
"data":[
{"symbol":"XBT","id":17999992000,"side":"Sell","size":100,"price":80},
{"symbol":"XBT","id":17999993000,"side":"Sell","size":20,"price":70},
{"symbol":"XBT","id":17999994000,"side":"Sell","size":10,"price":60},
{"symbol":"XBT","id":17999995000,"side":"Buy","size":10,"price":50},
{"symbol":"XBT","id":17999996000,"side":"Buy","size":20,"price":40},
{"symbol":"XBT","id":17999997000,"side":"Buy","size":100,"price":30}
]
}
let idx = 17999996000;
const findIndexObj = idx => Obj.data.findIndex(({id}) => id === idx);
const changeData = (idx, deleteCount = 1, elem) => elem ? Obj.data.splice(i,deleteCount, ...elem) : Obj.data.splice(i,deleteCount)
let i = findIndexObj(idx)
changeData(i)
console.table(Obj.data);
idx = 17999994000;
i = findIndexObj(idx) + 1;
let a = {id : 17999995500}, b = {id : 17999995501}, c = {id : 17999995502}
changeData(i,0, [a, b, c])
console.table(Obj.data);