Ejercicio 2

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

Thumbnail
This awesome code was written by carberrie, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright carberrie ©
  • HTML
  • CSS
  • JavaScript
    

/*Downloaded from https://www.codeseek.co/carberrie/ejercicio-2-xqeKbw */
    


/*Downloaded from https://www.codeseek.co/carberrie/ejercicio-2-xqeKbw */
    var matriz = [["a","b","c","d"], ["e","f","g","h"], ["i","j","k","l"], ["m","n","o","p"]];

//Funcion que recorre el arreglo y reversa elementos en determinados índices.
function serpiente(matriz) {
	var sumaMatriz = (matriz[0].join("") + matriz[1].reverse().join("") + matriz[2].join("") + matriz[3].reverse().join("") );  
  return sumaMatriz;
}

document.write(serpiente(matriz));

Comments