Paracetamol.js💊| #82: Explica este código JavaScript

Cristian Fernando - Mar 21 '22 - - Dev Community

Explica este código JavaScript

console.log("--- Menú ---");
console.log("" + ".".repeat(5) + ":" + "$1.50");
console.log("café" + ".".repeat(3.2) + ":" + "$3.75");
console.log("cerveza" + ".".repeat(-1) + ":" + "$5.00");
Enter fullscreen mode Exit fullscreen mode

A.

--- Menú---
.....:$1.50
café...:$3.75
RangeError: repeat count must be non-negative
Enter fullscreen mode Exit fullscreen mode

B.

--- Menú---
.....:$1.50
café...:$3.75
cerveza:$5.00
Enter fullscreen mode Exit fullscreen mode

C.

--- Menú---
.....:$1.50
RangeError: repeat count must be non-decimal numbers
RangeError: repeat count must be non-negative numbers
Enter fullscreen mode Exit fullscreen mode

Respuesta en el primer comentario.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player