fork download
  1. const a=[10,30,43,64,34,64,5,45,98];
  2. const b=[];
  3. const c=[];
  4. const str="";
  5. let i;
  6. for(i=0; i<a.length; i++)
  7. {
  8. if(a[i]%2==0)
  9. {
  10. b[i]=a[i];
  11. console.log("B="+b[i]);
  12. }
  13. else
  14. if(a[i]%2==1)
  15. {
  16. c[i]=a[i];
  17. console.log(c[i]);
  18. }
  19. }
  20.  
Success #stdin #stdout 0.03s 25952KB
stdin
Standard input is empty
stdout
const a=[10,30,43,64,34,64,5,45,98];
const b=[];
const c=[];
const str="";
let i;
for(i=0; i<a.length; i++)
{
if(a[i]%2==0)
{
b[i]=a[i];
console.log("B="+b[i]);
}
else
if(a[i]%2==1)
{
c[i]=a[i];
console.log(c[i]);
}
}