javascript alert

Given an array,print the sum of the even and odd numbers in the array.Javascript Program

const number=[3,4,5,12]; let sum=0; let sum1=0; for(let i=0;i<number.length;i++) { if(number[i]%2==0) { sum=sum+number[i]; } else if(number[i]%2==1) { sum1=sum1+number[i]; } } console.log('Even… Read More

Given an array,print the sum and count of the multiples of 3 in the array. Javascript Program

const number=[3,4,5,12]; let sum=0; let count=0; for(let i=0;i<number.length;i++) { if(number[i]%3==0) { sum=sum+number[i]; count++; } } console.log('3Sum='+sum+',3Count='+count); Read More

What is an array.Why do we use arrays

An array is a data structure, which can store a fixed-size collection of elements of the same data type. An… Read More

Write a Javascript program for Insert Angular, React and Node after Javascript

const techs=['Python','Javascript','C','Java']; console.log(techs); for(let i=0;i<techs.length;i++) { if(techs[i]=='Javascript') { techs.splice(i+1,0,'Angular','React','Node'); break; } } console.log(techs); Read More

Remove Hello from array Javascript Program with source code

const strings=['Hi','Hello','X','Y']; for(let i=0;i<strings.length;i++) { if(strings[i]=='Hello') { strings.splice(i,1); break; } } console.log(strings); Read More

This website uses cookies.