Angular Typescript Loop particular number replace

Angular Typescript Loop particular number replace


Hi,

Today Discuss Angular Typescript Superset Script How to replace Particular number looping let's start discussion follow this code. Loop every language is commonly used 

Angular Typescript Loop particular number replace
Angular Typescript Loop particular number replace


let a = 100;
let str:any =[];
let ar:any = [];
for(var i=1;i<a;i++){

if(i==4){
ar.push('buzz');
} else {
ar.push(i);
}
}
console.log(ar); ////Replaced 4 number only Buzz
Angular Typescript Loop particular number replace Dev2Tricks 5 of 5
Angular Typescript Loop particular number replace Hi, Today Discuss Angular Typescript Superset Script How to replace Particular n...

Share this

Related Posts

Previous
Next Post »