const heroName=["Jhonson","Vin Diesel","Ryan Reynolds"];
heroName.splice(1,1,"Hero Alom");
console.log(heroName);
const heroNames=["Jhonson","Vin Diesel","Ryan Reynolds"];
const arr= heroNames.splice(1,1,"Hero Alom");
console.log(arr);
**heroName.splice() output alright
but arr output i can not understand.
please anyone can explain what is the main reason
**