Skip to content

Commit

Permalink
Update object_basics.md (#29281)
Browse files Browse the repository at this point in the history
Closes #29251
  • Loading branch information
nedwards06 authored Jan 6, 2025
1 parent 7e45ecc commit af8c70b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion foundations/javascript_basics/object_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ console.log(mappedArr); // Outputs [2, 3, 4, 5, 6]
console.log(arr); // Outputs [1, 2, 3, 4, 5]
```

This is a much more elegant approach, what do you think? For simplicity, we could also define an inline function right inside of `map` like so:
Using `map` in this way is much more elegant than writing a `for` loop and iterating over the array. But we can do even better. We can define an inline function right inside of `map` like so:

```javascript
const arr = [1, 2, 3, 4, 5];
Expand Down

0 comments on commit af8c70b

Please sign in to comment.