I am handling a Javascript function to have a behaviour below:
1/ When the checkbox button is checked, an array of setting strings is inserted into another array
var RB_array_1=[];
var mycheckboxButton1 = document.getElementById('mycheckboxButton1');
if (mycheckboxButton.checked===true) {
RB_array_1=["setting A_1","setting B_1"]
}
2/ It will insert into another array while it remain the array inside previously:
const final_array =
[ RB_array_1
, RB_array_2
, ...
, RB_array_x
]
and it should remain array inside the array:
const final_array =
[ [ 'setting A_1', 'setting B_1']
, [ 'setting A_2', 'setting B_2']
, ...
, [ 'setting A_x', 'setting B_x']
]
Is there any way to insert an array into another array ?
final_array.push(RB_array_1)?