Generation

generate functionThu, 15 Dec 2022

exponential calculator from input String

function getExponent(str) { const strArr = str.split("^"); const base = parseInt(strArr[0], 10); const exp = parseInt(strArr[1], 10); return Math.pow(base, exp); } getExponent("2^4")

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant