Answer the question
In order to leave comments, you need to log in
How to remove a number from an array in JSON?
How to remove a number from an array in JSON?[123, 125, 555]
Answer the question
In order to leave comments, you need to log in
1. You need to accept the fact that this is also an array
2. You need to realize that node is still a "prefix" to js
3. Solution
3.1. delete method
var a = [123, 125, 555];
delete a[1];
console.log(a);
//[123, null, 555]
a.splice(1,1); // первое число это индекс, второе - количество удаляемых. Функция вернёт удаленные элементы, поэтому просто её вызываем
console.log(a);
// [123, 555]
a = a.filter( (index, value) => index != 1 );
console.log(a);
// [123, 555]
Now, just first I'll take out my crystal ball and see how your JSON looks like with numbers...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question