Skip to content

Instantly share code, notes, and snippets.

@mgiagante
mgiagante / .Xresources
Created April 15, 2019 19:26
There are comments with links to the Arch wiki on how to configure the plugins. Other than that, I use a Nerd Font but you can opt not to.
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
xvt.color12: rgb:5c/5c/ff
XTerm*background: #222D31
// La funcion llamada 'sumaTodosPrimos' recibe como argumento un array de enteros.
// y debe devolver la suma total entre todos los numeros que sean primos.
// Pista: un número primo solo es divisible por sí mismo y por 1
// Nota: Los números 0 y 1 NO son considerados números primos
// Ej:
// sumaTodosPrimos([1, 5, 2, 9, 3, 4, 11]) devuelve 5 + 2 + 3 + 11 = 21
function sumaTodosPrimos(numeros) {
const primos = numeros.filter(numero => esPrimo(numero));
const sumador = (accumulador, valorActual) => accumulador + valorActual;