Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Instrucciones

Los arrays son una estructura de datos simple que se usa en todas partes de la programación. Hay muchas formas de interactuar con arrays en JavaScript.

Hoy, explorarán los arrays y se enseñarán a sí mismos diferentes métodos para manipularlos.

Para cada una de estas tareas, escriban su código directamente en el archivo de la tarea. ¡Los scripts de calificación evaluarán lo que hayan escrito!


Tareas

  1. Usen el método arr.push() para llenar un array vacío con los números del 1 al 20, en orden.

  2. Usen el método arr.reverse() para invertir el orden del array dado.

  3. Usen el método arr.splice() para insertar el número faltante en el array dado, en la posición correcta.

  4. Usen el método arr.splice() para eliminar uno de los dos números duplicados en el array dado.


Tareas Extra

¡Si han completado las tareas anteriores, intenten las siguientes tareas extra como desafío adicional!

  1. Usen join() en el array dado para imprimir una cadena de números separados por comas solamente, ¡sin espacios!

  2. Usen concat() para fusionar los dos arrays dados, arr1 y arr2, en orden, y luego impriman el nuevo array creado.

  3. Una matriz es un array de arrays, que representa una cuadrícula con filas y columnas. ¡Usen esta tarea para experimentar con matrices!

    • ¿Pueden agregar un solo número a una fila existente?
    • ¿Pueden agregar una fila completa de números?
    • ¿Pueden eliminar un solo número de una sola fila?
    • ¿Pueden invertir una de las filas sin afectar a las demás?

Instructions

Arrays are a simple data structure used everywhere in programming. There are many ways to interact with arrays in JavaScript.

Today, you will be exploring arrays, and teaching yourselves different methods for manipulating them.

For each of these tasks, type your code directly in the task file - the marking scripts will evaluate what you have written!

Tasks

  1. Use the arr.push() method to populate an empty array with the numbers 1 to 20, in order.

  2. Use the arr.reverse() method to reverse the order of the given array.

  3. Use the arr.splice() method to insert the missing number in the given array at the correct position.

  4. Use the arr.splice() method to delete one of the two duplicate numbers in the given array.

Extra Tasks

If you have completed the above tasks, try the following extra tasks for a bonus challenge!

  1. Use join() on the given array to print a string of numbers from it, separated by commas only - no spaces!

  2. Use concat() to merge the two given arrays, arr1 and arr2, in order, and then print the new array that's created.

  3. A matrix is an array of arrays, representing a grid with rows and columns. Use this task to experiment with matrices!

    • Can you add a single number to an existing row?
    • Can you add a whole new row of numbers?
    • Can you remove a single number from a single row?
    • Can you reverse one of the rows without affecting the others

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages