xxxxxxxxxx
// Works using Slice
setWorkoutsNum((workoutsNum) => {
let newWorkouts = workoutsNum.slice();
newWorkouts.push(1);
return newWorkouts;
}
// Does NOT work without slice
setWorkoutsNum((workoutsNum) => {
//This makes a refereance, not a copy
let newWorkouts = workoutsNum;
newWorkouts.push(1);
return newWorkouts;
}