Mo Zargham 437ba8b103 fix(curriculum): Read-search-ask link now point to correct url as noted in the issue (#37753)
* fix: broken Read-search-ask link now point to correct url

* fix: changed link to original forum link with more views

* fix: changed http links to correct version

* fix: link in help modal
2019-11-19 19:54:48 -05:00

2.0 KiB

id, title, isRequired, challengeType, videoUrl, localeTitle
id title isRequired challengeType videoUrl localeTitle
a302f7aae1aa3152a5b413bc Factorialize a Number true 5 Factorializar un número

Description

Devuelve el factorial del entero proporcionado. Si el número entero se representa con la letra n, un factorial es el producto de todos los números enteros positivos menores o iguales a n. Los factoriales a menudo se representan con la notación abreviada n! Por ejemplo: 5! = 1 * 2 * 3 * 4 * 5 = 120 Solo se proporcionarán a la función números enteros mayores o iguales a cero. Recuerda usar Read-Search-Ask si te atascas. Escribe tu propio código.

Instructions

Tests

tests:
  - text: <code>factorialize(5)</code> debe devolver un número.
    testString: 'assert(typeof factorialize(5) === "number", "<code>factorialize(5)</code> should return a number.");'
  - text: <code>factorialize(5)</code> debe devolver 120.
    testString: 'assert(factorialize(5) === 120, "<code>factorialize(5)</code> should return 120.");'
  - text: <code>factorialize(10)</code> debe devolver 3628800.
    testString: 'assert(factorialize(10) === 3628800, "<code>factorialize(10)</code> should return 3628800.");'
  - text: <code>factorialize(20)</code> debe devolver 2432902008176640000.
    testString: 'assert(factorialize(20) === 2432902008176640000, "<code>factorialize(20)</code> should return 2432902008176640000.");'
  - text: <code>factorialize(0)</code> debe devolver 1.
    testString: 'assert(factorialize(0) === 1, "<code>factorialize(0)</code> should return 1.");'

Challenge Seed

function factorialize(num) {
  return num;
}

factorialize(5);

Solution

// solution required