Hey guys i am currently learning javascript, i need to replace "-" with "_". For example : "Hello-World" ==> "Hello_World" i tired the below code it didn't work,i want to know why this method is wrong,
function kS(n){
j=n.length;
for(i=0;i<j;i++){
if(n[i]=="-")
{
n[i]="_";
console.log(n);
}
}
}