const arr1 = [1,2,3,4]
const arr2 = [5,6,7]
// arr1.push(...arr2)
console.log(arr1)
function mergeArrays(array1, array2) {
const mergedArray = [];
const maxLength = Math.max(array1.length, array2.length);
for (let i = 0; i < maxLength; i++) {
if (i < array1.length) mergedArray.push(array1[i]);
if (i < array2.length) mergedArray.push(array2[i]);
}
return mergedArray;
}
console.log(mergeArrays(arr1, arr2))
console.log(["sdas", null, undefined, false, "tsg","",0].filter(Boolean))
const items = [1, 2, 3];
console.log(items); // [1, 2, 3]
const reversedItems = items.reverse();
console.log(reversedItems); // [3, 2, 1]
console.log(items); // [1, 2, 3]
To embed this project on your website, copy the following code and paste it into your website's HTML: