Answer the question
In order to leave comments, you need to log in
Array.push method what is the problem?
Hi all. Whether I overheated already, in general, something incomprehensible.
Who can advise? Why can't I add a new object to an array of objects using the push method?
Why is it showing me a number in the console?
const errors = [
{
isEmptyError: false,
textError: ''
},
{
minLengthError: false,
textError: '',
},
];
const newArray = errors.push({
minLengthError: false,
textError: 'Something',
});
console.log(newArray)
Answer the question
In order to leave comments, you need to log in
The push() method adds one or more elements to the end of an array and returns the new length of the array.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question