Files

32 lines
509 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Manipulate Arrays With pop()
---
# Manipulate Arrays With pop()
2018-10-12 15:37:13 -04:00
---
2018-10-12 15:37:13 -04:00
## Problem Explanation
Get rid of the last element in the array. Then, assign that ridden element to `removedFromMyArray`.
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
Call `.pop()` on the array, and assign it to `removedFromMyArray`.
---
## Solutions
<details><summary>Solution 1 (Click to Show/Hide)</summary>
2018-10-12 15:37:13 -04:00
```javascript
var removedFromMyArray = myArray.pop();
var arr = [1, 2, 3, 4, 5];
arr.pop(); // This got rid of 5
```
</details>