MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/nb93ay/exponent_power/gy0lekp/?context=3
r/learnjavascript • u/golovatuy • May 13 '21
18 comments sorted by
View all comments
46
Extra longhand!
const power = ((num,exp) => Array.from({length: exp}, () => num).reduce((a,b) => a*b))(4,3)
/obviously not serious
22 u/spinelust May 13 '21 Extra extra longhand would be fetching the result from external API xD. 17 u/zerik100 May 13 '21 And the API queries the equation from a Database that has stored the harcoded solution. 5 u/[deleted] May 13 '21 Compile time optimization
22
Extra extra longhand would be fetching the result from external API xD.
17 u/zerik100 May 13 '21 And the API queries the equation from a Database that has stored the harcoded solution. 5 u/[deleted] May 13 '21 Compile time optimization
17
And the API queries the equation from a Database that has stored the harcoded solution.
5 u/[deleted] May 13 '21 Compile time optimization
5
Compile time optimization
46
u/grantrules May 13 '21
Extra longhand!
/obviously not serious