Skip to content

Commit 7e41ad5

Browse files
authored
Update 04-javascript.md (#1209)
this arrow function uses implicit return. an explicit `return` throws an error.
1 parent 13282a7 commit 7e41ad5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ <h2>Usage with Javascript</h2>
11141114
<p>You can also use a simple function to add the animations classes and remove them automatically:</p>
11151115
<pre><code class="language-javascript">const animateCSS = (element, animation, prefix = 'animate__') =&gt;
11161116
// We create a Promise and return it
1117-
return new Promise((resolve, reject) =&gt; {
1117+
new Promise((resolve, reject) =&gt; {
11181118
const animationName = `${prefix}${animation}`;
11191119
const node = document.querySelector(element);
11201120

docsSource/sections/04-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can also use a simple function to add the animations classes and remove them
3030
```javascript
3131
const animateCSS = (element, animation, prefix = 'animate__') =>
3232
// We create a Promise and return it
33-
return new Promise((resolve, reject) => {
33+
new Promise((resolve, reject) => {
3434
const animationName = `${prefix}${animation}`;
3535
const node = document.querySelector(element);
3636

0 commit comments

Comments
 (0)