chore(i18n,learn): processed translations (#50953)

This commit is contained in:
camperbot 2023-07-12 23:09:32 +05:30 committed by GitHub
parent 8107cb4765
commit 4f4b92f29c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 1117 additions and 997 deletions

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
قم بتشغيل الاختبارات لرؤية المخرجات المتوقعة لكل method. الـ methods التي تأخذ argument يجب أن تقبل argument واحدة فقط ويجب أن تكون string. يجب أن تكون هذه الـ methods هي الوسيلة الوحيدة المتاحة للتفاعل مع الـ object.
قم بتشغيل الاختبارات لرؤية المخرجات المتوقعة لكل method. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
لا يجب إضافة أي خواص. `Object.keys(bob).length` يجب دائما أن يرجع 6.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` يجب أن يرجع `true`.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` يجب أن يرجع `undefined`.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` يجب أن يرجع `undefined`.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` يجب أن يرجع السلسلة `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` يجب أن يعيد السلسلة `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` يجب أن يعيد السلسلة `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` يجب أن يعيد السلسلة `Haskell Ross` بعد `bob.setFirstName("Haskell")`.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` يجب أن يعيد السلسلة `Haskell Curry` بعد `bob.setLastName("Curry")`.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` يجب أن يعيد السلسلة `Haskell Curry` بعد `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` يجب أن يعيد السلسلة `Haskell` بعد `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` يجب أن يعيد السلسلة `Curry` بعد `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
قم بإزالة الأسلوب الافتراضي لعناصر القائمة `.answers-list`، وأزال padding من القائمة الغير منظمة (unordered list).
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
يجب عليك استخدام منتقي `.answers-list`.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
يجب أن تعطي `.answers-list` خاصية `list-style` بقيمة `none`.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
يجب أن تعطي `.answers-list` خاصية `padding` بقيمة `0`.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ assert(
assert(document.querySelectorAll('a').length >= 2);
```
يجب عليك إضافة علامة فتح واحد فقط لـ (`a`). الرجاء إزالة أي زيادات.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
運行測試以查看每個方法的預期輸出。 方法接收一個參數,因此必須要有一個參數,並且其類型應該爲字符串。 這些方法必須是與對象交互的唯一可用方法。
運行測試以查看每個方法的預期輸出。 These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
不應添加屬性。 `Object.keys(bob).length` 應返回 6。
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` 應返回 `true`
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` 應該返回 `undefined`
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` 應該返回 `undefined`
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` 應該返回字符串 `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` 應該返回字符串 `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` 應該返回字符串 `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` 應該在 `bob.setFirstName("Haskell")` 之後返回字符串 `Haskell Ross`
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` 應該在 `bob.setLastName("Curry")` 之後返回字符串 `Haskell Curry`
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` 應該返回字符串 `Haskell Curry` 之後的 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` 應該返回字符串 `Haskell` 之後的 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` 應該返回字符串 `Curry` 之後 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
刪除 `.answers-list` 列表項的默認樣式,並刪除無序列表 padding。
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
你應該使用 `.answers-list` 選擇器。
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
你應該爲 `.answers-list` 添加 `list-style` 值爲 `none`
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
你應該爲 `.answers-list` 添加 `padding` 值爲 `0`
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ assert(
assert(document.querySelectorAll('a').length >= 2);
```
你應該只添加一個錨點(`a`)開始標籤。 請刪除多餘的。
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
运行测试以查看每个方法的预期输出。 方法接收一个参数,因此必须要有一个参数,并且其类型应该为字符串。 这些方法必须是与对象交互的唯一可用方法。
运行测试以查看每个方法的预期输出。 These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
不应添加属性。 `Object.keys(bob).length` 应返回 6。
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` 应返回 `true`
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` 应该返回 `undefined`
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` 应该返回 `undefined`
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` 应该返回字符串 `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` 应该返回字符串 `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` 应该返回字符串 `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` 应该在 `bob.setFirstName("Haskell")` 之后返回字符串 `Haskell Ross`
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` 应该在 `bob.setLastName("Curry")` 之后返回字符串 `Haskell Curry`
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` 应该返回字符串 `Haskell Curry` 之后的 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` 应该返回字符串 `Haskell` 之后的 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` 应该返回字符串 `Curry` 之后 `bob.setFullName("Haskell Curry")`
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
删除 `.answers-list` 列表项的默认样式,并删除无序列表 padding。
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
你应该使用 `.answers-list` 选择器。
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
你应该为 `.answers-list` 添加 `list-style` 值为 `none`
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
你应该为 `.answers-list` 添加 `padding` 值为 `0`
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ assert(
assert(document.querySelectorAll('a').length >= 2);
```
你应该只添加一个锚点(`a`)开始标签。 请删除多余的。
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Ejecuta las pruebas para ver el resultado esperado para cada método. Los métodos que toman un argumento deben aceptar sólo un argumento y tiene que ser una cadena. Estos métodos deben ser el único medio disponible para interactuar con el objeto.
Ejecuta las pruebas para ver el resultado esperado para cada método. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
No se deben agregar propiedades. `Object.keys(bob).length` siempre debe devolver 6.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` debe devolver `true`.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` debe devolver `undefined`.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` debe devolver `undefined`.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` debe devolver la cadena `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` debe devolver la cadena `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` debe devolver la cadena `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` debe devolver la cadena `Haskell Ross` after `bob.setFirstName("Haskell")`.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` debe devolver la cadena `Haskell Curry` después de `bob.setLastName("Curry")`.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` debe devolver la cadena `Haskell Curry` después de `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` debe devolver la cadena `Haskell` después de `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` debe devolver la cadena `Curry` después de `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
Elimina el estilo predeterminado para los elementos de la lista `.answers-list`, y elimina el relleno de la lista desordenada.
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
Debes usar el selector `.answers-list`.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Debes dar al `.answers-list` un `list-style` de `none`.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Debes dar al `.answers-list` un `padding` de `0`.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ Your anchor (`a`) element should have an opening tag. Opening tags have this syn
assert(document.querySelectorAll('a').length >= 2);
```
You should only add one opening anchor (`a`) tag. Please remove any extras.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Führe die Tests durch, um die erwartete Ausgabe für jede Methode zu sehen. Die Methoden, die ein Argument annehmen, dürfen nur ein Argument akzeptieren, welches ein String sein muss. Diese Methoden müssen die einzigen verfügbaren Möglichkeiten sein, um mit dem Objekt zu interagieren.
Führe die Tests durch, um die erwartete Ausgabe für jede Methode zu sehen. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
Es sollten keine Eigenschaften hinzugefügt werden. `Object.keys(bob).length` sollte immer 6 zurückgeben.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` sollte `true` zurückgeben.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` sollte `undefined` zurückgeben.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` sollte `undefined` zurückgeben.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` sollte den String `Bob` zurückgeben.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` sollte den String `Ross` zurückgeben.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` sollte den String `Bob Ross` zurückgeben.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` sollte den String `Haskell Ross` nach `bob.setFirstName("Haskell")` zurückgeben.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` sollte den String `Haskell Curry` nach `bob.setLastName("Curry")` zurückgeben.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` sollte den String `Haskell Curry` nach `bob.setFullName("Haskell Curry")` zurückgeben.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` sollte den String `Haskell` nach `bob.setFullName("Haskell Curry")` zurückgeben.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` sollte den String `Curry` nach `bob.setFullName("Haskell Curry")` zurückgeben.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
Entferne die Standardformatierung für die Listenelemente von `.answers-list` sowie das Padding der ungeordneten Liste.
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
Du solltest den `.answers-list`-Selektor verwenden.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Du solltest `.answers-list` ein `list-style` von `none` geben.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Du solltest `.answers-list` ein `padding` von `0` geben.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ Dein (`a`)-Ankerelement sollte ein öffnendes Tag haben. Öffnende Tags haben fo
assert(document.querySelectorAll('a').length >= 2);
```
Du solltest nur ein einleitendes (`a`)-Ankertag hinzufügen. Entferne bitte alles Zusätzliche.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -7,11 +7,11 @@ dashedName: step-2
# --description--
Within your `head` element, add a `meta` tag with the `charset` attribute set to `utf-8`. Also add a `title` element with the text `Picasso Painting`.
Füge in dein `head`-Element ein `meta`-Tag mit dem `charset`-Attribut von `utf-8` hinzu. Füge auch ein `title`-Element mit dem Text `Picasso Painting` hinzu.
# --hints--
You should add exactly one `meta` element.
Du solltest genau ein `meta`-Element hinzufügen.
```js
assert(document.querySelectorAll('meta').length === 1);
@ -23,19 +23,19 @@ Your `meta` element should have a `charset` attribute.
assert(document.querySelector('meta')?.getAttribute('charset'));
```
Your `charset` attribute should be set to `utf-8`.
Dein `charset`-Attribut sollte auf `utf-8` gesetzt sein.
```js
assert(document.querySelector('meta')?.getAttribute('charset')?.toLowerCase() === 'utf-8');
```
You should add exactly one `title` element.
Du solltest genau ein `title`-Element hinzufügen.
```js
assert(document.querySelectorAll('title').length === 1);
```
Your `title` element should have the text `Picasso Painting`. Beachte, dass Recht- und Großschreibung von Bedeutung sind.
Dein `title`-Element sollte den Text `Picasso Painting` enthalten. Beachte, dass Recht- und Großschreibung von Bedeutung sind.
```js
assert(document.querySelector('title')?.innerText === 'Picasso Painting');

View File

@ -9,7 +9,7 @@ dashedName: step-10
The `z-index` property is used to create "layers" for your HTML elements. If you are familiar with image editing tools, you may have worked with layers before. This is a similar concept.
Elements with a higher `z-index` value will appear to be layered on top of elements with a lower `z-index` value. This can be combined with the positioning in the previous lesson to create unique effects.
Elemente mit einem höheren `z-index`-Wert werden über den Elementen mit einem niedrigeren `z-index`-Wert angeordnet sein. This can be combined with the positioning in the previous lesson to create unique effects.
Since the `back-wall` element will need to appear "behind" the other elements you will be creating, give the `back-wall` element a `z-index` of `-1`.

View File

@ -11,25 +11,25 @@ Verwende einen Klassenselektor, um mit der `black-dot`-Klasse eine Regel für di
# --hints--
You should have a `.black-dot` selector.
Du solltest einen `.black-dot`-Selektor haben.
```js
assert(new __helpers.CSSHelp(document).getStyle('.black-dot'));
```
Your `.black-dot` selector should have a `width` property set to `10px`.
Dein `.black-dot`-Selektor sollte eine `width`-Eigenschaft von `10px` enthalten.
```js
assert(new __helpers.CSSHelp(document).getStyle('.black-dot')?.width === '10px');
```
Your `.black-dot` selector should have a `height` property set to `10px`.
Dein `.black-dot`-Selektor sollte eine `height`-Eigenschaft von `10px` enthalten.
```js
assert(new __helpers.CSSHelp(document).getStyle('.black-dot')?.height === '10px');
```
Your `.black-dot` selector should have a `background-color` property set to `rgb(45, 31, 19)`.
Dein `.black-dot`-Selektor sollte eine `background-color`-Eigenschaft von `rgb(45, 31, 19)` enthalten.
```js
assert(new __helpers.CSSHelp(document).getStyle('.black-dot')?.backgroundColor === 'rgb(45, 31, 19)');

View File

@ -11,7 +11,7 @@ Gib dem `#eyes-div`-Element einen `z-index` von `3`.
# --hints--
Your `#eyes-div` selector should have a `z-index` property set to `3`.
Dein `#eyes-div`-Selektor sollte eine `z-index`-Eigenschaft von `3` besitzen.
```js
assert(new __helpers.CSSHelp(document).getStyle('#eyes-div')?.zIndex === '3');

View File

@ -7,7 +7,7 @@ dashedName: step-76
# --description--
Verwende nun einen id-Selektor für `guitar`. Set the `width` to `100%`, and the `height` to `100px`.
Now use an id selector for `guitar`. Set the `width` to `100%`, and the `height` to `100px`.
# --hints--

View File

@ -7,7 +7,7 @@ dashedName: step-4
# --description--
Nest a second `div` within your existing `div`, and set the `class` to be `keys`.
Bette ein zweites `div` innerhalb deines vorhandenen `div` ein und setze die `class` auf `keys`.
# --hints--

View File

@ -11,7 +11,7 @@ Setze die `margin` von `#piano` auf `80px auto`.
# --hints--
Your `#piano` selector should have the `margin` property set to `80px auto`.
Dein `#piano`-Selektor sollte die `margin`-Eigenschaft auf `80px auto` gesetzt haben.
```js
assert(new __helpers.CSSHelp(document).getStyle('#piano')?.margin === '80px auto');

View File

@ -27,7 +27,7 @@ const hasBorder = new __helpers.CSSHelp(document).getCSSRules().some(x => x.styl
assert(hasBorder);
```
Your `.frame` element should have a `50px solid black` `border`.
Dein `.frame`-Element sollte eine `border`-Eigenschaft mit dem Wert `50px solid black` enthalten.
```js
const frameBorder = new __helpers.CSSHelp(document).getStyle('.frame')?.getPropertyValue('border');

View File

@ -25,7 +25,7 @@ const hasWidth = new __helpers.CSSHelp(document).getCSSRules().some(x => x.style
assert(hasWidth);
```
Your `.one` element should have a `width` value of `425px`.
Dein `.one`-Element sollte einen `width`-Wert von `425px` enthalten.
```js
const oneWidth = new __helpers.CSSHelp(document).getStyle('.one')?.getPropertyValue('width');

View File

@ -48,7 +48,7 @@ assert(telephoneCheck('5555555555') === true);
assert(telephoneCheck('555-555-5555') === true);
```
`telephoneCheck("(555)555-5555")` should return `true`.
`telephoneCheck("(555)555-5555")` sollte `true` zurückgeben.
```js
assert(telephoneCheck('(555)555-5555') === true);

View File

@ -7,7 +7,7 @@ dashedName: step-6
# --description--
Similar to your `#stats` element, your `#monsterStats` element needs two `span` elements. Gib ihnen die Klasse `stat` und gib dem ersten Element den Text `Monster Name:` und dem zweiten den Text `Health:`. After the text in each, add a `strong` element with an empty nested `span` element.
Ähnlich wie dein `#stats`-Element benötigt dein `#monsterStats`-Element zwei `span`-Elemente. Gib ihnen die Klasse `stat` und gib dem ersten Element den Text `Monster Name:` und dem zweiten den Text `Health:`. After the text in each, add a `strong` element with an empty nested `span` element.
# --hints--
@ -18,7 +18,7 @@ const spans = document.querySelectorAll(`#monsterStats > span`);
assert.equal(spans.length, 2);
```
Your new `span` elements should both have a `class` value of `stat`.
Deine neuen `span`-Elemente sollten beide einen `class`-Wert von `stat` haben.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);
@ -26,21 +26,21 @@ assert.equal(spans[0].className, 'stat');
assert.equal(spans[1].className, 'stat');
```
Your first `span` element should have the text `Monster Name:`. Achte darauf, dass die Abstände korrekt sind.
Dein erstes `span`-Element sollte den Text `Monster Name:` haben. Achte darauf, dass die Abstände korrekt sind.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);
assert.equal(spans[0].innerText, 'Monster Name: ');
```
Your second `span` element should have the text `Health:`. Achte darauf, dass die Abstände korrekt sind.
Dein zweites `span`-Element sollte den Text `Health:` haben. Achte darauf, dass die Abstände korrekt sind.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);
assert.equal(spans[1].textContent, 'Health: ');
```
Your first `span` element should have a `strong` element with an empty nested `span` element.
Dein erstes `span`-Element sollte ein `strong`-Element mit einem leeren eingebetteten `span`-Element enthalten.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);
@ -50,7 +50,7 @@ assert.exists(strong);
assert.exists(span);
```
Your second `span` element should have a `strong` element with an empty nested `span` element.
Dein zweites `span`-Element sollte ein `strong`-Element mit einem leeren eingebetteten `span`-Element enthalten.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);
@ -60,7 +60,7 @@ assert.exists(strong);
assert.exists(span);
```
Your `strong` and `span` elements should come after the text.
Deine `strong` und `span`-Elemente sollten nach dem Text kommen.
```js
const spans = document.querySelectorAll(`#monsterStats > span`);

View File

@ -25,7 +25,7 @@ const display = new __helpers.CSSHelp(document).getStyle('#monsterStats')?.getPr
assert.equal(display, 'none');
```
Your `#monsterStats` selector should have a `border` of `1px solid black`.
Dein `#monsterStats`-Selektor sollte einen `border` von `1px solid black` haben.
```js
const border = new __helpers.CSSHelp(document).getStyle('#monsterStats')?.getPropertyValue('border');

View File

@ -7,7 +7,7 @@ dashedName: step-84
# --description--
The value of the `currentWeapon` variable corresponds to an index in the `weapons` array. The player starts with a `stick`, since `currentWeapon` starts at `0` and `weapons[0]` is the `stick` weapon.
Der Wert deiner `currentWeapon`-Variable entspricht einem Index im `weapons`-Array. Der Spieler beginnt mit einem `stick`, da `currentWeapon` bei `0` beginnt und `weapons[0]` die `stick`-Waffe ist.
In the `buyWeapon` function, use compound assignment to add `1` to `currentWeapon` - the user is buying the next weapon in the `weapons` array.
@ -19,7 +19,7 @@ Du solltest eine zusammengesetzte Zuweisung verwenden, um eine zu `currentWeapon
assert.match(buyWeapon.toString(), /currentWeapon\s*\+=\s*1/);
```
Your `buyWeapon` function should increase `currentWeapon` by `1`.
Deine `buyWeapon`-Funktion sollte `currentWeapon` um `1` erhöhen.
```js
gold = 30;

View File

@ -23,7 +23,7 @@ Du solltest bei `currentWeapon` die Klammer-Notation verwenden, um auf `weapons`
assert.match(attack.toString(), /weapons\[currentWeapon\]/);
```
You should use dot notation to access the `power` property of `weapons[currentWeapon]`.
Du solltest die Punktnotation verwenden, um auf die `power`-Eigenschaft von `weapons[currentWeapon]` zuzugreifen.
```js
assert.match(attack.toString(), /weapons\[currentWeapon\]\.power/);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Esegui i test per vedere l'output atteso per ogni metodo. I metodi che prendono un argomento devono accettare un solo argomento ed esso deve essere una stringa. Questi metodi devono essere gli unici mezzi disponibili per interagire con l'oggetto.
Esegui i test per vedere l'output atteso per ogni metodo. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
Nessuna proprietà dovrebbe essere aggiunta. `Object.keys(bob).length` dovrebbe sempre restituire 6.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` dovrebbe restituire `true`.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` dovrebbe restituire `undefined`.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` dovrebbe restituire `undefined`.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` dovrebbe restituire la stringa `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` dovrebbe restituire la stringa `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` dovrebbe restituire la stringa `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` dovrebbe restituire la stringa `Haskell Ross` dopo `bob.setFirstName("Haskell")`.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` dovrebbe restituire la stringa `Haskell Curry` dopo `bob.setLastName("Curry")`.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` dovrebbe restituire la stringa `Haskell Curry` dopo `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` dovrebbe restituire la stringa `Haskell` dopo `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` dovrebbe restituire la stringa `Curry` dopo `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
Rimuovi lo stile predefinito per gli elementi della lista di `.answers-list` e rimuovi il padding della lista non ordinata.
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
Dovresi usare il selettore `.answers-list`.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Dovresti dare ad `.answers-list` una proprietà `list-style` con il valore `none`.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Dovresti dare ad `.answers-list` un `padding` di `0`.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ L'elemento di ancoraggio (`a`) dovrebbe avere un tag di apertura. I tag di apert
assert(document.querySelectorAll('a').length >= 2);
```
Dovresti aggiungere un solo tag di apertura di ancoraggio (`a`). Rimuovi quelli di troppo.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
テストを実行して、各メソッドに対して期待される出力を確認してください。 引数を取るメソッドは 1 つの引数のみを受け取る必要があり、それは文字列でなければなりません。 これらのメソッドのみをオブジェクトとやり取りする手段とする必要があります。
テストを実行して、各メソッドに対して期待される出力を確認してください。 These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
プロパティを追加しないでください。 `Object.keys(bob).length` は常に 6 を返す必要があります。
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person``true` を返す必要があります。
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName``undefined` を返す必要があります。
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName``undefined` を返す必要があります。
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` は文字列 `Bob` を返す必要があります。
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` は文字列 `Ross` を返す必要があります。
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` は文字列 `Bob Ross` を返す必要があります。
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` は、`bob.setFirstName("Haskell")` の後に文字列 `Haskell Ross` を返す必要があります。
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` は、`bob.setLastName("Curry")` の後に文字列 `Haskell Curry` を返す必要があります。
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` は、`bob.setFullName("Haskell Curry")` の後に文字列 `Haskell Curry` を返す必要があります。
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` は、`bob.setFullName("Haskell Curry")` の後に文字列 `Haskell` を返す必要があります。
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` は、`bob.setFullName("Haskell Curry")` の後に文字列 `Curry` を返す必要があります。
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
`.answers-list` のリスト項目のデフォルトのスタイルを除去し、さらに順序なしリストのパディングを除去してください。
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
`.answers-list` セレクターを使用する必要があります。
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
`.answers-list``list-style``none` に設定する必要があります。
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
`.answers-list``padding``0` に設定する必要があります。
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ assert(
assert(document.querySelectorAll('a').length >= 2);
```
アンカー (`a`) の開始タグは 1 つだけ追加してください。 余分なものは削除してください。
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Execute os testes para ver a saída esperada para cada método. Os métodos que recebem um argumento têm de aceitar apenas um argumento e tem de ser uma string. Estes métodos devem constituir o único meio de interação com o objeto.
Execute os testes para ver a saída esperada para cada método. Estes métodos devem constituir o único meio de interação com o objeto. Cada teste declara uma nova instância de `Person` como `new Person('Bob', 'Ross')`.
# --hints--
Nenhuma propriedade deve ser adicionada. `Object.keys(bob).length` deve sempre retornar 6.
Você não deve alterar a assinatura da função.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Pessoa` deve retornar `true`.
Você não deve reatribuir o parâmetro `first`.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` deve retornar `undefined`.
Você não deve reatribuir o parâmetro `last`.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` deve retornar `undefined`.
Nenhuma propriedade deve ser adicionada. `Object.keys(Person).length` deve sempre retornar 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` deve retornar a string `Bob`.
Você deve ser capaz de instanciar o objeto `Person`.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` deve retornar a string `Ross`.
O objeto `Person` deve ter a propriedade `firstName`.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` deve retornar a string `Bob Ross`.
O objeto `Person` deve ter a propriedade `lastName`.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` deve retornar a string `Haskell Ross` após `bob.setFirstName("Haskell")`.
O método `.getFirstName()` deve retornar a string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` deve retornar a string `Haskell Curry` após `bob.setLastName("Curry")`.
O método `.getLastName()` deve retornar a string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` deve retornar a string `Haskell Curry` após `bob.setFullName("Haskell Curry")`.
O método `.getFullName()` deve retornar a string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` deve retornar a string `Haskell` após `bob.setFullName("Haskell Curry")`.
O método `.getFullName()` deve retornar a string `Haskell Ross` após a chamada de `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` deve retornar a string `Curry` após `bob.setFullName("Haskell Curry")`.
O método `.getFullName()` deve retornar a string `Bob Curry` após a chamada de `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
O método `.getFullName()` deve retornar a string `Haskell Curry` após a chamada de `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
O método `.getFirstName()` deve retornar a string `Haskell` após a chamada de `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
O método `.getLastName()` deve retornar a string `Curry` após a chamada de `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
O método `.getFullName()` deve retornar a string `Emily Martinez de la Rosa` após a chamada de `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
O método `.getFirstName()` deve retornar a string `Emily Martinez` após a chamada de `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
O método `.getLastName()` deve retornar a string `de la Rosa` após a chamada de `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,7 +7,15 @@ dashedName: step-61
# --description--
Remova o estilo padrão para os itens da lista de `.answers-list` e remova o preenchimento da lista não ordenada.
Embora os elementos `ul`/`li` sejam ótimos para fornecer itens de lista, os botões de opção (radio buttons) não precisam deles. Você pode controlar a aparência dos marcadores dos itens com a propriedade `list-style`. Por exemplo, você pode transformar os pontos em círculos da seguinte maneira:
```css
ul {
list-style: circle;
}
```
Remova o estilo padrão para os itens de `.answers-list` configurando o estilo para `none` e remova o preenchimento (padding) da lista não ordenada.
# --hints--
@ -17,13 +25,13 @@ Você deve usar o seletor `.answers-list`.
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Você deve dar ao `.answers-list` uma `list-style` de `none`.
Você deve dar a `.answers-list` um `list-style` de `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Você deve dar ao `.answers-list` uma `padding` de `0`.
Você deve dar a `.answers-list` um `padding` de `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ O elemento de âncora (`a`) deve ter uma tag de abertura. As tags de abertura t
assert(document.querySelectorAll('a').length >= 2);
```
Você deve adicionar apenas uma tag de abertura para o elemento de âncora (`a`). Remova as tags adicionais.
Está faltando uma tag de fechamento (`a`) após a imagem.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Run the tests to see the expected output for each method. The methods that take an argument must accept only one argument and it has to be a string. These methods must be the only available means of interacting with the object.
Run the tests to see the expected output for each method. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
No properties should be added. `Object.keys(bob).length` should always return 6.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` should return `true`.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` should return `undefined`.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` should return `undefined`.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` should return the string `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` should return the string `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` should return the string `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` should return the string `Haskell Ross` after `bob.setFirstName("Haskell")`.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` should return the string `Haskell Curry` after `bob.setLastName("Curry")`.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` should return the string `Haskell Curry` after `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` should return the string `Haskell` after `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` should return the string `Curry` after `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
Ondoa mtindo chaguomsingi wa vipengee vya orodha ya `.answers-list`, na uondoe pedi za orodha zisizopangwa.
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
Unapaswa kutumia kichaguzi cha `.answers-list`.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Unapaswa kuipa `.answers-list` `list-style` ya `none`.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Unapaswa kuipa `.answers-list` `padding` ya `0`.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ Kipengele chako cha nanga (`a`) kinapaswa kuwa na tagi ya ufunguzi. Tagi za ufun
assert(document.querySelectorAll('a').length >= 2);
```
Unapaswa kuongeza tu tagi moja ya ufunguzi ya (`a`). Tafadhali ondoa ziada yoyote.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);

View File

@ -16,160 +16,166 @@ getLastName()
getFullName()
setFirstName(first)
setLastName(last)
setFullName(firstAndLast)
setFullName(first, last)
```
Запустіть тести, щоб побачити очікуваний вивід для кожного методу. Методи, що приймають аргумент, повинні приймати лише один аргумент і це повинен бути рядок. Ці методи повинні бути єдиними доступними засобами для взаємодії з об’єктом.
Запустіть тести, щоб побачити очікуваний вивід для кожного методу. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--
Не треба додавати жодних властивостей. `Object.keys(bob).length` завжди має повертати 6.
You should not change the function signature.
```js
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
assert.match(code, /const\s+Person\s*=\s*function\s*\(\s*first\s*,\s*last\s*\)\s*{/);
```
`bob instanceof Person` має повертати `true`.
You should not reassign the `first` parameter.
```js
assert.deepEqual(_test_bob instanceof Person, true);
assert.notMatch(code, /first\s*=\s*/);
```
`bob.firstName` має повертати `undefined`.
You should not reassign the `last` parameter.
```js
assert.deepEqual(_test_bob.firstName, undefined);
assert.notMatch(code, /last\s*=\s*/);
```
`bob.lastName` має повертати `undefined`.
No properties should be added. `Object.keys(Person).length` should always return 6.
```js
assert.deepEqual(_test_bob.lastName, undefined);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
person.setLastName('Curry');
person.setFullName('John', 'Smith');
assert.lengthOf(Object.keys(person), 6);
```
`bob.getFirstName()` має повертати рядок `Bob`.
You should be able to instantiate your `Person` object.
```js
assert.deepEqual(_test_bob.getFirstName(), 'Bob');
const person = new Person('Bob', 'Ross');
assert.instanceOf(person, Person);
```
`bob.getLastName()` має повертати рядок `Ross`.
Your `Person` object should not have a `firstName` property.
```js
assert.deepEqual(_test_bob.getLastName(), 'Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'firstName');
```
`bob.getFullName()` має повертати рядок `Bob Ross`.
Your `Person` object should not have a `lastName` property.
```js
assert.deepEqual(_test_bob.getFullName(), 'Bob Ross');
const person = new Person('Bob', 'Ross');
assert.notProperty(person, 'lastName');
```
`bob.getFullName()` має повертати рядок `Haskell Ross` після `bob.setFirstName("Haskell")`.
The `.getFirstName()` method should return the string `Bob`.
```js
assert.strictEqual(
(function () {
_test_bob.setFirstName('Haskell');
return _test_bob.getFullName();
})(),
'Haskell Ross'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFirstName(), 'Bob');
```
`bob.getFullName()` має повертати рядок `Haskell Curry` після `bob.setLastName("Curry")`.
The `.getLastName()` should return the string `Ross`.
```js
assert.strictEqual(
(function () {
var _bob = new Person('Haskell Ross');
_bob.setLastName('Curry');
return _bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getLastName(), 'Ross');
```
`bob.getFullName()` має повертати рядок `Haskell Curry` після `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Ross`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFullName();
})(),
'Haskell Curry'
);
const person = new Person('Bob', 'Ross');
assert.strictEqual(person.getFullName(), 'Bob Ross');
```
`bob.getFirstName()` має повертати рядок `Haskell` після `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Haskell Ross` after calling `.setFirstName('Haskell')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getFirstName();
})(),
'Haskell'
);
const person = new Person('Bob', 'Ross');
person.setFirstName('Haskell');
assert.strictEqual(person.getFullName(), 'Haskell Ross');
```
`bob.getLastName()` має повертати рядок `Curry` після `bob.setFullName("Haskell Curry")`.
The `.getFullName()` method should return the string `Bob Curry` after calling `.setLastName('Curry')`.
```js
assert.strictEqual(
(function () {
_test_bob.setFullName('Haskell Curry');
return _test_bob.getLastName();
})(),
'Curry'
);
const person = new Person('Bob', 'Ross');
person.setLastName('Curry');
assert.strictEqual(person.getFullName(), 'Bob Curry');
```
The `.getFullName()` method should return the string `Haskell Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFullName(), 'Haskell Curry');
```
The `.getFirstName()` method should return the string `Haskell` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getFirstName(), 'Haskell');
```
The `.getLastName()` method should return the string `Curry` after calling `.setFullName('Haskell', 'Curry')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Haskell', 'Curry');
assert.strictEqual(person.getLastName(), 'Curry');
```
The `.getFullName()` method should return the string `Emily Martinez de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFullName(), 'Emily Martinez de la Rosa');
```
The `.getFirstName()` property should return the string `Emily Martinez` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getFirstName(), 'Emily Martinez');
```
The `.getLastName()` property should return the string `de la Rosa` after calling `.setFullName('Emily Martinez', 'de la Rosa')`.
```js
const person = new Person('Bob', 'Ross');
person.setFullName('Emily Martinez', 'de la Rosa');
assert.strictEqual(person.getLastName(), 'de la Rosa');
```
# --seed--
## --after-user-code--
```js
const _test_bob = new Person('Bob Ross');
```
## --seed-contents--
```js
const Person = function(firstAndLast) {
const Person = function(first, last) {
this.getFullName = function() {
return "";
};
return firstAndLast;
return "";
};
const bob = new Person('Bob Ross');
bob.getFullName();
```
# --solutions--
```js
const Person = function(firstAndLast) {
let firstName, lastName;
function updateName(str) {
firstName = str.split(" ")[0];
lastName = str.split(" ")[1];
}
updateName(firstAndLast);
const Person = function(first, last) {
let firstName = first;
let lastName = last;
this.getFirstName = function(){
return firstName;
@ -192,11 +198,9 @@ const Person = function(firstAndLast) {
lastName = str;
};
this.setFullName = function(str){
updateName(str);
this.setFullName = function(first, last){
firstName = first;
lastName = last;
};
};
const bob = new Person('Bob Ross');
bob.getFullName();
```

View File

@ -7,23 +7,31 @@ dashedName: step-61
# --description--
Видаліть стиль за замовчуванням для елементів списку `.answers-list` та видаліть відступ невпорядкованого списку.
While `ul`/`li` elements are great at providing bullets for list items, your radio buttons don't need them. You can control what the bullets look with the `list-style` property. For example you can turn your bullets into circles with the following:
```css
ul {
list-style: circle;
}
```
Remove the default styling for the `.answers-list` items by settings its style to `none`, and remove the unordered list padding.
# --hints--
Ви повинні використати селектор `.answers-list`.
You should use the `.answers-list` selector.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('.answers-list'));
```
Ви повинні надати `.answers-list` властивість `list-style` зі значенням `none`.
You should give `.answers-list` a `list-style` of `none`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.listStyle, 'none');
```
Ви повинні надати `.answers-list` властивість `padding` зі значенням `0`.
You should give `.answers-list` a `padding` of `0`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('.answers-list')?.padding, '0px');

View File

@ -29,7 +29,7 @@ assert(
assert(document.querySelectorAll('a').length >= 2);
```
Ви повинні додати лише один початковий теґ прив'язки (`a`). Будь ласка, видаліть всі зайві.
You are missing a closing (`a`) tag after the image.
```js
assert(document.querySelectorAll('a').length === 2);