Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ancestry = JSON.parse(ANCESTRY_FILE)
- var idadeMaesTiveramFilho = []
- function average(array) {
- function plus(a, b) { return a + b; }
- return array.reduce(plus) / array.length;
- }
- function HasMotherKnow(obj){
- if(obj.mother != null){
- const nomeMae = obj.mother;
- const dataNascimentoFilho = obj.born;
- ancestry.forEach(function(pessoinha){
- if (pessoinha.name === nomeMae){
- idadeMaesTiveramFilho.push(dataNascimentoFilho - pessoinha.born)
- }
- })
- }
- }
Add Comment
Please, Sign In to add comment