Give a same family name each family HELP!!
I want to give a same family name each family but it didn't work pretty well. The parent's name are same and different each family but the child's name not following the parent's name. I wanna know if theres some way to fix it. //part one msg("My name is " + this.name + ".") msg("My mother is " + randomName() + " " + randN + " (Age " + randomInt(20, 60) + ").") msg("My father is " + randomName() + " " + randN + " (Age " + randomInt(20, 60) + ").") msg("<br>") //second part var numberOfPersons = 10 var persons = [] for(var i = 0; i < numberOfPersons; i++){ var randN = randomName() var name = `${randomName()} ${randN}` var age = 0 var energy = randomInt(50, 200) var money = 0 var iq = randomInt(50, 100) var health = randomInt(50, 200) var relation = 0 persons.push(new Person(name, age, energy, money, iq, health, relation)) } https://code.sololearn.com/WmpsZo2vX64k/?ref=app