Skip to content

Commit 61a6306

Browse files
committed
update SkillfactoryCoding#10 fix fathername Никита
1 parent e52ad1b commit 61a6306

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

bjs/10_function_object/personGenerator.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ const personGenerator = {
135135

136136
randomFirstName: function() {
137137

138-
if (this.person.gender === this.GENDER_MALE)
139-
138+
if (this.person.gender === this.GENDER_MALE)
140139
{
141140
return this.randomValue(this.firstNameMaleJson);
142141
}
@@ -164,6 +163,18 @@ const personGenerator = {
164163

165164
let result = String(this.randomValue(this.firstNameMaleJson));
166165

166+
if (result == "Никита")
167+
{
168+
result = "Никитич";
169+
170+
if (this.person.gender === this.GENDER_FEMALE)
171+
{
172+
result = result + "на";
173+
}
174+
175+
return result;
176+
}
177+
167178
switch (result[result.length - 1]) {
168179
case "й":
169180
result = result.substring(0, result.length - 1) + "ев"

0 commit comments

Comments
 (0)