Để nối một mục vào một mảng JavaScript, hãy sử dụng phương thức push ().
Ví dụ
Bạn có thể thử chạy mã sau để thêm một mục:
<html>
<body>
<script>
var arr = ["marketing", "technical", "finance", "sales"];
arr.push("HR");
document.write(arr);
</script>
</body>
</html> Đầu ra
marketing,technical,finance,sales,HR