Professional Documents
Culture Documents
Coding
Coding
1. Write a function in JS which accepts 2 array parameters and should return the
output array having common items between the 2 input array?
<script>
const array1 = [4,5,10,9,8];
// const array2 = [5,10,8,9,4];
const array2 = [33,13,12,19,4];
<script>
function cookies(){
document.cookie = "item=Pen; expires=Sat, 02 May 2023 12:00:00 UTC";
alert(document.cookie);
}
cookies();
</script>