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