Quick actions

cmd+k|ctrl+k

Navigation

Languages

Custom Pow

Snippet info

Language

JavaScript

Visibility

public

Author

christian.lohr

Created

2016-04-28T01:14:33Z

Updated

2016-05-20T18:27:13Z

'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, 2));
INFO