Arreglos - Ejercicio Guiado

In this example below you will see how to do a Arreglos - Ejercicio Guiado with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by antocg, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright antocg ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Arreglos - Ejercicio Guiado</title>
  
  
  
  
  
</head>

<body>

  
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/antocg/arreglos-ejercicio-guiado-aJMxQo */
var arr1 = [[2,3],[2,4],[5,6],[2,8]];
var arr2 = [[5,2],[9,4],[3,5],[1,3]];

function cadena(arr1,arr2){
	var nuevoArr = [];
  for(var i = 0; i<arr1.length; i++){
  	nuevoArr.push(arr1[i][0] + arr1[i][1],arr2[i][0] + arr2[i][1]);
  }
  return nuevoArr;
}
document.write(cadena(arr1,arr2));

Comments