there is an array like data, about 500 + data. I want to form an array every 10 items and put them all in arr. Ask for advice
const data = [
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
{ img: "a" },
...
]
const arr = [
[{ img: "a" }, { img: "a" }, { img: "a" },],
[{ img: "a" }, { img: "a" }, { img: "a" },],
[{ img: "a" }, { img: "a" }, { img: "a" },],
[{ img: "a" }, { img: "a" }, { img: "a" },]
]