Extender el prototipo de Array
Extiende la estructura de array agregando las siguientes propiedades calculadas y métodos:
- squared
- cubed
- divisible(by: x)
- strictly(above: x)
- strictly(below: x)
Ejemplos
[1, 2, 3].squared ➞ [1, 4, 9]
[1, 2, 3].cubed ➞ [1, 8, 27]
[1, 2, 3, 4].divisible(by: 2) ➞ [2, 4]
[1, 2, 3, 4].strictly(above: 1) ➞ [2, 3, 4]
[1, 2, 3, 4].strictly(below: 2) ➞ [1]Notas
N/A