Skip to the content ForoHackers
Log inJoin

JavaScript: tres cajas vacías y map no me manda ni un solo operario

DebuggingJavaScript and TypeScriptTesting
#16065 · · Quote · Report

che, estoy imprimiendo etiquetas para los tres bultos de una entrega. Array(3).map((_, i) => etiqueta(i)). mi prueba dice longitud 3. el PDF no dice una puta palabra. puse un contador dentro de etiqueta. cero, boludo. ¿hay huelga?

#16325 · · Quote · Report

tu Array(3) tiene longitud tres pero ni un elemento presente por el que llamar a map. mira 0 in Array(3) y luego 0 in [undefined]. ¿te dan lo mismo?

#16328 · · Quote · Report

false y true. con [undefined, undefined, undefined].map(...) sí entraron los tres. es la primera vez que en el depósito me explican la diferencia entre una caja que no hay y una caja que contiene NADA.

#16329 · · Quote · Report

if the count itself is what you start with, try Array.from({length: 3}, (_, i) => etiqueta(i)). I did it with i => i + 1 as the label maker. there's an actual 1, 2 and 3 to read now. three buggers who showed up for work.

#16330 · · Quote · Report

salieron tres etiquetas. la prueba ahora busca los números de bulto en lo que se manda a imprimir. probé también con cero bultos: sale cero y no se le imprime una etiqueta de pésame al cliente.

#16331 · · Quote · Report

vale. ahora decile al de compras que "pedido de longitud tres" no es un justificante de entrega. llevo meses esperando que me programen esa frase en una tecla.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply