merge: resolve example mistake (#919)

This commit is contained in:
Fahim Faisaal
2022-03-10 22:55:06 +06:00
committed by GitHub
parent 5198af80a9
commit 4f6fe1975c

View File

@ -5,7 +5,7 @@
* @param {number} exponent
* @returns {number}
* @example - powLinear(2, 2) => 4 --> 2 * 2
* @example - powLinear(3, 3) => 27 --> 3 * 3
* @example - powLinear(3, 3) => 27 --> 3 * 3 * 3
*/
const powLinear = (base, exponent) => {
if (exponent < 0) {
@ -29,7 +29,7 @@ const powLinear = (base, exponent) => {
* @param {number} exponent
* @returns {number}
* @example - powFaster(2, 2) => 4 --> 2 * 2
* @example - powFaster(3, 3) => 27 --> 3 * 3
* @example - powFaster(3, 3) => 27 --> 3 * 3 * 3
*/
const powFaster = (base, exponent) => {
if (exponent < 2) { // explanation below - 1