freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../basic-javascript/storing-values-with-the-ass...

1.2 KiB

id title challengeType videoUrl localeTitle
56533eb9ac21ba0edf2244a8 Storing Values with the Assignment Operator 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(/var a;/.test(code) && /var b = 2;/.test(code), "Do not change code above the line");'
  - text: ''
    testString: 'assert(typeof a === "number" && a === 7, "<code>a</code> should have a value of 7");'
  - text: ''
    testString: 'assert(typeof b === "number" && b === 7, "<code>b</code> should have a value of 7");'
  - text: ''
    testString: 'assert(/b\s*=\s*a\s*;/g.test(code), "<code>a</code> should be assigned to <code>b</code> with <code>=</code>");'

Challenge Seed

// Setup
var a;
var b = 2;

// Only change code below this line

Before Test

if (typeof a != 'undefined') {
  a = undefined;
}
if (typeof b != 'undefined') {
  b = undefined;
}

After Test

console.info('after the test');

Solution

// solution required