1.7 KiB
1.7 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
56bbb991ad1ed5201cd392d3 | Delete Properties from a JavaScript Object | 1 | Удаление свойств из объекта JavaScript |
Description
delete ourDog.bark;
Instructions
"tails"
из myDog
. Вы можете использовать либо точечную, либо скобку. Tests
tests:
- text: Удалите свойство <code>"tails"</code> из <code>myDog</code> .
testString: 'assert(typeof myDog === "object" && myDog.tails === undefined, "Delete the property <code>"tails"</code> from <code>myDog</code>.");'
- text: Не изменяйте настройку <code>myDog</code>
testString: 'assert(code.match(/"tails": 1/g).length > 1, "Do not modify the <code>myDog</code> setup");'
Challenge Seed
// Example
var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"],
"bark": "bow-wow"
};
delete ourDog.bark;
// Setup
var myDog = {
"name": "Happy Coder",
"legs": 4,
"tails": 1,
"friends": ["freeCodeCamp Campers"],
"bark": "woof"
};
// Only change code below this line.
After Test
console.info('after the test');
Solution
// solution required