Skip to content

Instantly share code, notes, and snippets.

@venelrene
Created May 22, 2020 15:17
Show Gist options
  • Save venelrene/143294d4fef9d9c04ce6116a79e995cc to your computer and use it in GitHub Desktop.
Save venelrene/143294d4fef9d9c04ce6116a79e995cc to your computer and use it in GitHub Desktop.
This function takes two numbers as parameters, the first number being the coefficient, and the second number being the exponent. Your function should multiply the two numbers, and then subtract 1 from the exponent. Then, it has to print out an expression (like 28x^7). "^1" should not be truncated when exponent = 2.
function derive(coefficient,exponent) {
return `${coefficient*exponent}x^${exponent-1}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment