Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Exercise 12 - Calculator

The goal for this exercise is to create a calculator that does the following:

  1. add(): take two numbers and return their sum
  2. subtract(): take two numbers and return the result after subtracting the second from the first
  3. sum(): take an array of numbers and add all the numbers together
  4. multiply(): take an array of numbers and multiply all the numbers together
  5. power(): take two numbers (base and exponent) and return the result of raising the base to that exponent
  6. factorial(): given a single number, find its factorial

Please fill out each function with your solution. Make sure to return the value so you can test it in Jest! To see the expected value, take a look at the .spec.js file that houses the Jest test cases.