Skip to content

Instantly share code, notes, and snippets.

@NikBorn
Created November 25, 2017 23:25
Show Gist options
  • Save NikBorn/08db94337299ccb69eaa03b5fa013f75 to your computer and use it in GitHub Desktop.
Save NikBorn/08db94337299ccb69eaa03b5fa013f75 to your computer and use it in GitHub Desktop.
practice promise problems
  1. Write a function testNum that takes a number as an argument and returns a Promise that tests if the value is less than or greater than the value 10.
const testNum = (number) => {
  return new Promise((resolve, reject)=> {
    number > 10 ? resolve(number + ' is greater than 10, success!') : 
                  reject(number + ' is less than or eqaul to 10, error!')
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment