--- id: 56bbb991ad1ed5201cd392ce title: Manipulate Arrays With unshift() challengeType: 1 videoUrl: '' localeTitle: Manipular matrizes com unshift () --- ## Description
Não apenas você pode shift elementos do início de um array, você também pode unshift elementos para o início de um array, isto é, adicionar elementos na frente do array. .unshift() funciona exatamente como .push() , mas em vez de adicionar o elemento no final da matriz, unshift() adiciona o elemento no início da matriz.
## Instructions
Adicione ["Paul",35] ao início da variável myArray usando unshift() .
## Tests
```yml tests: - text: 'myArray agora deve ter [["Paul", 35], ["dog", 3]].' testString: 'assert((function(d){if(typeof d[0] === "object" && d[0][0] == "Paul" && d[0][1] === 35 && d[1][0] != undefined && d[1][0] == "dog" && d[1][1] != undefined && d[1][1] == 3){return true;}else{return false;}})(myArray), "myArray should now have [["Paul", 35], ["dog", 3]].");' ```
## Challenge Seed
```js // Example var ourArray = ["Stimpson", "J", "cat"]; ourArray.shift(); // ourArray now equals ["J", "cat"] ourArray.unshift("Happy"); // ourArray now equals ["Happy", "J", "cat"] // Setup var myArray = [["John", 23], ["dog", 3]]; myArray.shift(); // Only change code below this line. ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```