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);

Leave a Comment

Your email address will not be published. Required fields are marked *