[php] gjghj

Viewer

  1. <?php 
  2. echo 'const nums=function(){
  3. let par=[];
  4. let impar=[]
  5. let arreglo=[1,2,3,4,5,6,7,8,9,10];
  6. arreglo.forEach((elemento)=>{
  7.     if(elemento % 2 === 0){
  8.         par.push(elemento)
  9.     }else{
  10.         impar.push(elemento)
  11.     }
  12. })
  13. console.log("Numeros pares: "+ par)
  14.  
  15. console.log("Numeros impares: "+ impar)
  16.  
  17. return"";
  18. }';

Editor

You can edit this paste and save as new:


File Description
  • gjghj
  • Paste Code
  • 08 May-2024
  • 339 Bytes
You can Share it: