Skip to content

Commit

Permalink
Updating question 35
Browse files Browse the repository at this point in the history
  • Loading branch information
malipramod authored Jan 13, 2020
1 parent c6439af commit cb6acce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,16 @@ for (var i = 0; i < arr.length; i++) {
}
```
This can also achieve by forEach (allows you to keep that variable within the forEach’s scope)
```javascript
var arr = [10, 32, 65, 2];
arr.forEach(function(i) {
setTimeout(function() {
console.log('The index of this number is: ' + i);
}, 3000);
})
```
## Question 36. How to check if the value of a variable in an array?
Expand Down

0 comments on commit cb6acce

Please sign in to comment.