xxxxxxxxxx
const newArray = [array, source];
setArray(newArray);
xxxxxxxxxx
import { useState } from "react";
const yourComponent = () => {
const [array, setArray] = useState([]);
}
xxxxxxxxxx
var ar = [1, 2, 3, 4, 5, 6];
//do stuffar = [];
//a new, empty array!