Find Jobs
Hire Freelancers

build tree from an objects array

$10 USD

Peruutettu
Julkaistu noin 5 vuotta sitten

$10 USD

Maksettu toimituksen yhteydessä
i have an easy coding challenge, we have an array of objects: const banners = [ { country: 'fr', type: 'mobile', category: 'adult' }, { country: 'fr', type: 'mobile', category: 'non adult' }, { country: 'fr', type: 'desktop', category: 'adult' }, { country: 'ru', type: 'mobile', category: 'adult' }, { country: 'ru', type: 'mobile', category: 'non adult' }, { country: 'ru', type: 'desktop', category: 'adult' }, ] and i want a javaScript function that takes an array and a list of object keys to build a tree: fn(banners, ['country', 'type', 'category']) which returns: { fr: { mobile: { adult: [Array], ['non adult']: [Array] }, desktop: { adult: [Array], ['non adult']: [Array] } }, ru: { mobile: { adult: [Array], ['non adult']: [Array], }, desktop: { adult: [Array], ['non adult']: [Array], } } } really stucked with this challenge and need to save the time, anybody help to get a clean implementation. lodash solutions also accepted.
Projektin tunnus (ID): 19172370

Tietoa projektista

4 ehdotukset
Etäprojekti
Aktiivinen 5 vuotta sitten

Haluatko ansaita rahaa?

Freelancerin tarjouskilpailun edut

Aseta budjettisi ja aikataulu
Saa maksu työstäsi
Kuvaile ehdotustasi
Rekisteröinti ja töihin tarjoaminen on ilmaista
4 freelancerit tarjoavat keskimäärin $13 USD tätä projektia
Käyttäjän avatar
I have good knowledge of PHP, Ajax, Jquery and Javascript. I able to do this task very well with good quality. Our main motto is client satisfaction and makes a long-term relationship with you. Thank you
$10 USD 10 päivässä
5,0 (69 arvostelua)
5,9
5,9
Käyttäjän avatar
Hello, As I understand from the sample, the key at index 0 in the array will be the top parent, then index 1 will be the child of 0 and parent of 2 and so on. Need a bit clarification on: adult: [Array] - why is this an array? ['non-adult'] - This is not a valid key. What to do about this? Should the function take keys array of any length? Do contact me when available. Mateen
$10 USD 1 päivässä
5,0 (18 arvostelua)
3,8
3,8
Käyttäjän avatar
I can do this immediately, Can write a javascript function with documentation. Can discuss anything on chat If you want any specific requirement.
$20 USD 1 päivässä
5,0 (1 arvostelu)
1,0
1,0
Käyttäjän avatar
Not that hard, won't take too long. Depends on what language you want it, C, C++, Java or Python, Javascript. Python and Javascript will be the fastest to implement, then java and C++ and least will be C. Looking at the job, it doesn't even seem to be a job that offers $10, and I also think my bid ($5) is too much for this job.
$10 USD 2 päivässä
0,0 (0 arvostelua)
0,0
0,0

Tietoja asiakkaasta

Maan RUSSIAN FEDERATION lippu
Nakhodka, Russian Federation
5,0
3
Maksutapa vahvistettu
Liittynyt maalisk. 18, 2008

Asiakkaan vahvistus

Kiitos! Olemme lähettäneet sinulle sähköpostitse linkin, jolla voit lunastaa ilmaisen krediittisi.
Jotain meni pieleen lähetettäessä sähköpostiasi. Yritä uudelleen.
Rekisteröitynyttä käyttäjää Ilmoitettua työtä yhteensä
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ladataan esikatselua
Lupa myönnetty Geolocation.
Kirjautumisistuntosi on vanhentunut ja sinut on kirjattu ulos. Kirjaudu uudelleen sisään.