--- id: 56533eb9ac21ba0edf2244a8 title: Storing Values with the Assignment Operator challengeType: 1 videoUrl: '' localeTitle: Almacenamiento de valores con el operador de asignación --- ## Description
En JavaScript, puede almacenar un valor en una variable con el operador de asignación . myVariable = 5; Esto asigna el valor Number 5 a myVariable . La asignación siempre va de derecha a izquierda. Todo a la derecha del operador = se resuelve antes de que el valor se asigne a la variable a la izquierda del operador.
myVar = 5;
myNum = myVar;
Esto asigna 5 a myVar y luego resuelve myVar a 5 nuevamente y lo asigna a myNum .
## Instructions
Asigne el valor 7 a la variable a . Asigna los contenidos de a a variable b .
## Tests
```yml tests: - text: No cambie el código por encima de la línea testString: 'assert(/var a;/.test(code) && /var b = 2;/.test(code), "Do not change code above the line");' - text: a debe tener un valor de 7 testString: 'assert(typeof a === "number" && a === 7, "a should have a value of 7");' - text: b debe tener un valor de 7 testString: 'assert(typeof b === "number" && b === 7, "b should have a value of 7");' - text: a debe asignarse a b con = testString: 'assert(/b\s*=\s*a\s*;/g.test(code), "a should be assigned to b with =");' ```
## Challenge Seed
```js // Setup var a; var b = 2; // Only change code below this line ```
### Before Test
```js if (typeof a != 'undefined') { a = undefined; } if (typeof b != 'undefined') { b = undefined; } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```