Új elemet szűr be az Array példány végére.
push() push(element1) push(element1, element2) push(element1, element2, /* …, */ elementN)
const animals = ['pigs', 'goats', 'sheep'] const count = animals.push('cows') console.log(count) // Expected output: 4 console.log(animals) // Expected output: Array ["pigs", "goats", "sheep", "cows"] animals.push('chickens', 'cats', 'dogs') console.log(animals) // Expected output: Array ["pigs", "goats", "sheep", "cows", "chickens", "cats", "dogs"]