--- id: cf1111c1c11feddfaeb8bdef title: Modify Array Data With Indexes challengeType: 1 videoUrl: '' localeTitle: Modificar dados de matriz com índices --- ## Description
Ao contrário das strings, as entradas das matrizes são mutáveis e podem ser alteradas livremente. Exemplo
var ourArray = [50,40,30];
ourArray [0] = 15; // é igual a [15,40,30]
Nota
Não deve haver espaços entre o nome da matriz e os colchetes, como array [0] . Embora JavaScript seja capaz de processar isso corretamente, isso pode confundir outros programadores lendo seu código.
## Instructions
Modifique os dados armazenados no índice 0 de myArray para um valor de 45 .
## Tests
```yml tests: - text: 'myArray agora deve ser [45,64,99].' testString: 'assert((function(){if(typeof myArray != "undefined" && myArray[0] == 45 && myArray[1] == 64 && myArray[2] == 99){return true;}else{return false;}})(), "myArray should now be [45,64,99].");' - text: Você deve estar usando o índice correto para modificar o valor em myArray . testString: 'assert((function(){if(code.match(/myArray\[0\]\s*=\s*/g)){return true;}else{return false;}})(), "You should be using correct index to modify the value in myArray.");' ```
## Challenge Seed
```js // Example var ourArray = [18,64,99]; ourArray[1] = 45; // ourArray now equals [18,45,99]. // Setup var myArray = [18,64,99]; // Only change code below this line. ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```