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;Esto asigna
myNum = myVar;
5
a myVar
y luego resuelve myVar
a 5
nuevamente y lo asigna a myNum
. 7
a la variable a
. Asigna los contenidos de a
a variable b
. 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 =
");'
```