Loading...
Ivelinka avatar Ivelinka 24 Точки

Проблем с 1. Employees от Objects and Classes - Exercise

Здравейте, опитвам се да реша задачата с class constructor и получавам 66/100

Някой може ли да ми помогне ?

Благодаря :)

задача: https://judge.softuni.org/Contests/Compete/Index/1322#0

код:

function solve(input) {
  class Man {
            constructor(name, surname){
              this.name = name;
              this.surname = surname
            }
            display(){
              console.log(`Name: ${this.name + " " + this.surname} -- Personal Number: ${(this.name + " " + this.surname).length}`)
            }
          }
          let result = []
  input.map(x => {
    let[name, surname] = x.split(" ")
    let myMan = new Man(name, surname)
         result.push(myMan)
  })
  result.forEach(x => x.display())
 }

Тагове:
0
JavaScript Fundamentals
Axiomatik avatar Axiomatik 2422 Точки
function solve(input) {
    class Employee {
        constructor(name, id) {
            this.name = name;
            this.id = id;
        }

        printInfo() {
            console.log(`Name: ${this.name} -- Personal Number: ${this.id}`)
        }
    }

    let employeeList = [];

    for (let i = 0; i < input.length; i++) {
        let name = input[i];
        let id = name.length;
        let currentEmployee = new Employee(name, id);

        employeeList.push(currentEmployee);
    }

    employeeList.forEach(e => e.printInfo());
}

 

0
1
Ivelinka avatar Ivelinka 24 Точки

thanks :)

1
emilynorman avatar emilynorman 1 Точки

wow, it impressed me. basketball stars unblocked provides a pleasant and accessible experience for everyone, whether you're a basketball enthusiast or just seeking for some unblocked gaming fun.

0
vaansh avatar vaansh 0 Точки

We provide you horny Mahipalpur Escorts Service for preventing you to be caught by any last-minute hassle. Our professional and cheap escorts in Mahipalpur leave no stone unturned to make your night wonderful.

0
Gibbonbon avatar Gibbonbon 0 Точки

I'm attempting to master the art of run 3 class management.

0
shanayasharma avatar shanayasharma 0 Точки

We are Cheap Defence Colony Escorts Agency Service serving our reputed customers for many years. We have made highest level of quality regarding customer pleasure. Unlike other escorts agencies & Independent Escorts we offer the vast variety of escort girl to our consumers to select from at cheapest rates.
 

0
satyamsingh1 avatar satyamsingh1 1 Точки

Local Escort in Karol Bagh are the most beautiful call girls that you ever find. All call girl's services are 24*7 available for clients. Our 50% Off is a limited-time offer scheme. So don’t you think that is too late? With our cash payment option, customers can get the pleasure option that they are looking for. So what are you now waiting for? pick up your phone and contact us through the given information. 

0
Kaabir avatar Kaabir 0 Точки

One of the fundamental demands of every adult is sexual activity. There are countless ways to achieve complete fun. However, the manner our skilled and seductive Delhi Escorts 100% Satisfy their clients' kinky obsessions is the most alluring. You will receive the most satisfaction and value from our excellent
 

0
satyamsingh1 avatar satyamsingh1 1 Точки

We have recruited some of the most Beautiful and sexiest models in the country with the sole aim of providing a high class Escorts in South Delhi The beauty and appeal of our model with their curves, sexy bodies and wonderful smiles will surpass even the ladies of your dreams and fantasies

0
satyamsingh1 avatar satyamsingh1 1 Точки

If you are not that lucky to have a beautiful girlfriend, Escorts Servcie in Delhi plays an important role in this. We have many hot and sexy Escorts in Delhi who know how to sensationalize a party and have some amazing time with men. Most of these beauties are the ones who are studying in college or working in big companies here.
 

 

Delhi Escorts Service || Delhi Call Girls || Call Girls in Delhi || Delhi Escorts || Escorts in Delhi || Delhi Escorts Service || Delhi Call Girls || Call Girls in Delhi || Delhi Escorts || Escorts in Delhi ||

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.