fix/grammar+punctuation
This commit is contained in:
parent
6f24bc5d41
commit
d3cf6f42dd
@ -6,7 +6,7 @@ challengeType: 1
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
A promise in JavaScript is exactly what it sounds like. You use it to make a promise to do something, usually asynchronously. When the task completes you either fulfill your promise or fail to do so. <code>Promise</code> is a constructor function, so you need to use the <code>new</code> keyword to create one. It takes a function as its argument with two parameters, <code>resolve</code> and <code>reject</code>. These are methods used to determine the outcome of the promise. The syntax looks like this:
|
||||
A promise in JavaScript is exactly what it sounds like. You use it to make a promise to do something, usually asynchronously. When the task completes, you either fulfill your promise or fail to do so. <code>Promise</code> is a constructor function, so you need to use the <code>new</code> keyword to create one. It takes a function as its argument with two parameters: <code>resolve</code> and <code>reject</code>. These are methods used to determine the outcome of the promise. The syntax looks like this:
|
||||
|
||||
```js
|
||||
const myPromise = new Promise((resolve, reject) => {
|
||||
|
@ -19,7 +19,7 @@ myPromise.then(result => {
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
Add the <code>then</code> method to your promise. Use <code>result</code> as the argument of its callback function and log <code>result</code> to the console.
|
||||
Add the <code>then</code> method to your promise. Use <code>result</code> as the parameter of its callback function and log <code>result</code> to the console.
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
@ -16,12 +16,12 @@ myPromise.catch(error => {
|
||||
|
||||
<code>error</code> is the argument passed in to the <code>reject</code> method.
|
||||
|
||||
<strong>Note:</strong> the <code>then</code> and <code>catch</code> methods can be chained to the promise declaration if you chose.
|
||||
<strong>Note:</strong> the <code>then</code> and <code>catch</code> methods can be chained to the promise declaration if you choose.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
Add the <code>catch</code> method to your promise. Use <code>error</code> as the argument of its callback function and log <code>error</code> to the console.
|
||||
Add the <code>catch</code> method to your promise. Use <code>error</code> as the parameter of its callback function and log <code>error</code> to the console.
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
Loading…
x
Reference in New Issue
Block a user