Quick actions

cmd+k|ctrl+k

Navigation

Languages

Custom Math.pow

Snippet info

Language

JavaScript

Visibility

public

Author

smtudor

Created

2016-04-28T15:43:48Z

Updated

2016-04-28T15:43:48Z

'use strict';

const pow = (base, exponent) => {
    const arr = Array.apply(null, Array(exponent));
    return arr.map(() => base).reduce((total, int) => total * int, 1);
};
    
console.log(pow(10, 3));
INFO