mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
merge: resolve example mistake (#919)
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
* @param {number} exponent
|
* @param {number} exponent
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
* @example - powLinear(2, 2) => 4 --> 2 * 2
|
* @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) => {
|
const powLinear = (base, exponent) => {
|
||||||
if (exponent < 0) {
|
if (exponent < 0) {
|
||||||
@ -29,7 +29,7 @@ const powLinear = (base, exponent) => {
|
|||||||
* @param {number} exponent
|
* @param {number} exponent
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
* @example - powFaster(2, 2) => 4 --> 2 * 2
|
* @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) => {
|
const powFaster = (base, exponent) => {
|
||||||
if (exponent < 2) { // explanation below - 1
|
if (exponent < 2) { // explanation below - 1
|
||||||
|
Reference in New Issue
Block a user