i was coding and i found this problem, the goal is turn the items array into a object with property key/value, counting the items that appear more than once like that:
{
cookie:{
MILK: 1,
CHOCOLATE: 2,
DELUXE: 1
},
bread:{
BIG: 2
},
beer:{
NEW: 1,
OLD: 1
}
}
I tried this code below
const items = [
"cookie-MILK",
"cookie-CHOCOLATE",
"cookie-CHOCOLATE",
"cookie-DELUXE",
"bread-BIG",
"bread-BIG",
"beer-NEW",
"beer-OLD"
]
let newArray = [];
items.forEach((e) => {
let splitArray = e.split("-");
newArray.push([splitArray[0], splitArray[1]]);
});
let result = newArray.reduce((acc, val) => {
if (!acc[val[0]] && !acc[val[1]] ) acc[val[0]] = {
[val[1]]: 1,
};
else acc[val[0]][val[1]]++;
return acc;
}, {});
But this code returns it and i don’t know how to solve this question
{
cookie:{
MILK: 1,
CHOCOLATE: NaN,
DELUXE: NaN
},
bread:{
BIG: 2
},
beer:{
NEW: 1,
OLD: NaN
}
}
http://withouthims.com how long does viagra last
https://cialisbob.com/ tadalafil generic cost
http://levitradd.com/ recommended dosage of levitra
https://levitradd.com/ levitra canadian pharmacy
http://ivermectinus.com ivermectin tablets for sale
https://himscanada.com/ buying cialis online
brand cialis online usa – medical pharmacy south best cheap cialis
stromectol cvs – stromectol medicine stromectol how much it cost
http://quicken4loans.com installment loans for bad credit
https://stromectolhumans.com/ what is stromectol used for
https://iwermectin.com/ stromectol
http://viagraxyu.com viagra soft tablets
zithromax 250mg dose – buy zithromax 500mg buy zithromax online zithropls
femail viagra – chewable sildenafil where to buy sildenafil 100mg
http://ivermectineffects.com/ stromectol
https://ivermectinovercounter.com/ ivermectin tablets for humans
http://ivermectineffects.com ivermectin over the counter
what supplements lower blood pressure how many people suffer mental health issues
ivermectin over the counter https://ivermectinhome.com
http://ivermectinus.com/ ivermectin for humans over the counter is
https://zithrozpack.com/ cost of generic azithromycin
levitra 10 mg generic http://levitrair.com where to buy levitra cheap
erectile dysfunction blowjob what do stds look like
ivermectina como tomar https://ivermectinhome.com
how to lower systolic blood pressure impotence efinition
ivermectin for humans for sale https://ivermectinhome.com
can i buy cialis over the counter in usa – Samples of cialis cialis tablets generic
http://albuterolotc.com/ ventolin inhaler coupons
ivermectin human dosage http://stromectolus.com ivermectin trial
mens ed pills – male enhancement products best place to buy ed pills online
find internal medicine doctor medicine logo
ivermectin tablets for humans https://ivermectinhome.com
ivermectin http://ivermcov.com/# ivermectin
javascript-help.li with otc drugs http://pharmvolk.com canada online pharmacies
how does french health care work https://ventolinhfaer.com/ ventolin hfa aer coupon
why msm hiv are health insurance premiums tax deductible
ivermectin cream https://ivermectinhome.com
javascript-help.li and ivermectin tablets http://ivermectini.com ivermectin tablets
buy one get one free hearing aids is ivermectin a prescription drug http://iveramectin.com ivermectin human dosage
javascript-help.li with stromectol http://ivermectiny.com buy 3 mg ivermectin tablets
cialis 20mg for sale – where can i buy cialis in canada canadian pharmacy viagra 50 mg
where to buy accutane – buy cheap accutane online how much is accutane prescription
canada viagra without a doctor prescriptions https://viagrob.com viagra premature ejaculation
buy amoxicilin 500 – buy amoxicillina noscript price of amoxicillin 500 mg
javascript-help.li and ivermektinovГЅ koronavirus http://ivermectinhum.com ivermectin dosage
stromectol germany ivermectin https://stromectl.com ivermrctin tablets
10mg prednisone – where to buy prednisone online without a script prednisone 10 tablet
javascript-help.li and ivermectin https://ivermectiny.com ivermectin kaufen
cytotec 200mcg – how to get cytotec over the counter cheap cytotec pills
ivermectin cost in usa – ivermectina 6 mg ivermectin cream canada cost
azithromycin 500 mg dosage recommendations https://azithrozpack.com azithromycin over counter
http://stromectolo.com – generic ivermectin
stromektol sД±vД± https://ivermectin1.com/ ivermectin pills otc
sildenafil online usa – cheapest sildenafil online free sildenafil
term papers writing – where can i buy a research paper pre written essays for sale
buy stromectol 12mg – ivermectin uk stromectol 6mg online
generic allegra cvs – https://allergyd.com
buy vardenafil 20mg – canadian neighbor pharmacy over the counter ed pills at walgreens
https://stromectolforte.com/# ivermectin dosage chart for humans
tadalafil over the counter – cialis medication viagra vs cialis
how much is employee health insurance with wife added on http://tadalafilkiva.com – buy cialis usa
ivermectin https://stromectolforte.com/# ivermectin tablets buy ivermectina
viagra 130mg otc – samples of viagra viagra buy online no prescription
viagra 50mg pill – viagra next day delivery online viagra best
where to buy cialis online australia – cialis prices where to get cialis in singapore
buy ivermectin uk https://stromectoloff.com/ comprimidos de estromectol
stromectol 3 mg http://ivermectinhum.com/ ivermektin pro ДЌlovД›ka
This paragraph provides clear idea in favor
of the new visitors of blogging, that in fact how to do blogging and site-building.
My partner and I absolutely love your blog and find the majority
of your post’s to be exactly I’m looking for. Does one offer guest
writers to write content for you? I wouldn’t mind writing a post or elaborating on most of the subjects you write concerning
here. Again, awesome web site!
I do believe all of the concepts you’ve presented for your post.
They’re really convincing and will definitely work. Nonetheless, the
posts are very brief for beginners. Could you please extend them a bit from next
time? Thank you for the post.
My brother recommended I might like this web site.
He was totally right. This post truly made my day.
You cann’t imagine just how much time I had spent for this info!
Thanks!
prednisone brand name canada – where to buy prednisone tablets 5443 prednisone
Attractive element of content. I just stumbled upon your blog and in accession capital to claim that I acquire
actually loved account your blog posts. Any way I’ll be subscribing for your augment or even I fulfillment you get entry to persistently
quickly.
I know this if off topic but I’m looking into starting my own weblog and was wondering what
all is required to get setup? I’m assuming having a blog
like yours would cost a pretty penny? I’m not very web
savvy so I’m not 100% certain. Any tips or advice would be greatly appreciated.
Kudos
buy prednisone 40mg online – prednisone 5 mg how can i order prednisone
how much is prednisone 20 mg – prednisone 10 mg pills prednisone 20 mg medication
order accutane from india – buy accutane 40 mg online cheap accutane 40 mg
https://lasixotc.com walnuts and erectile dysfunction
Whoa! This blog looks exactly like my old one! It’s on a completely different topic but it has pretty
much the same layout and design. Excellent choice
of colors!
I’m gone to tell my little brother, that he should also visit this blog on regular basis
to obtain updated from latest gossip.
Right now it looks like Drupal is the preferred blogging platform out there right now.
(from what I’ve read) Is that what you are using on your blog?
Can I just say what a relief to uncover an individual who really understands what they are discussing on the
web. You actually know how to bring a problem to light and
make it important. More people have to read this and understand
this side of your story. I can’t believe you’re not
more popular since you most certainly possess the gift.
I really like it whenever people get together and share opinions.
Great website, keep it up!
I have learn a few good stuff here. Certainly worth bookmarking for revisiting.
I wonder how so much effort you set to make any such excellent informative
site.
Thanks for your personal marvelous posting! I truly enjoyed reading it, you happen to be a great author.
I will be sure to bookmark your blog and will often come back very
soon. I want to encourage you to ultimately continue your great job, have a nice
weekend!
Excellent blog here! Also your site loads
up fast! What host are you using? Can I get your affiliate
link to your host? I wish my site loaded up as
fast as yours lol
Wow, wonderful weblog layout! How long have you ever been running a blog for?
you made running a blog glance easy. The full look
of your web site is great, as neatly as the content material!
Good day! This is kind of off topic but I need some advice from an established blog.
Is it very difficult to set up your own blog?
I’m not very techincal but I can figure things out pretty quick.
I’m thinking about making my own but I’m not sure where to start.
Do you have any tips or suggestions? Thanks
Ahaa, its nice discussion regarding this article
at this place at this webpage, I have read all that, so at this time me also commenting at this place.
I really like what you guys are usually up too. This kind of clever
work and coverage! Keep up the superb works guys I’ve added you guys to my own blogroll.
ivermectin uk – ivermectin lotion cost buy oral ivermectin
Hi there, I found your web site by way of Google while looking
for a related subject, your website came up, it appears to
be like good. I have bookmarked it in my google bookmarks.
Hello there, just became alert to your blog thru Google, and
located that it’s really informative. I am gonna be careful for brussels.
I’ll appreciate if you continue this in future. Many people can be benefited out of your writing.
Cheers!
best online casino real money – casino games online real money empire city casino online
Your style is really unique in comparison to other people
I have read stuff from. I appreciate you for posting when you’ve got
the opportunity, Guess I will just bookmark this blog.
This paragraph will help the internet visitors for
setting up new webpage or even a blog from start to end.
If you want to get a good deal from this paragraph then you have to
apply such techniques to your won webpage.
excellent put up, very informative. I ponder why the opposite specialists of this sector don’t notice
this. You should continue your writing. I am sure, you have a huge readers’ base already!
Magnificent website. Plenty of helpful information here.
I am sending it to a few buddies ans also sharing in delicious.
And naturally, thanks in your sweat!
You can certainly see your skills within the work you write.
The sector hopes for even more passionate writers such as
you who are not afraid to mention how they believe.
All the time go after your heart.
With havin so much content do you ever run into any problems of plagorism or copyright infringement?
My site has a lot of unique content I’ve either authored
myself or outsourced but it looks like a lot of it is popping it up all over the web without
my authorization. Do you know any methods to help stop content from being stolen? I’d genuinely
appreciate it.
This is a topic that’s near to my heart… Thank you! Exactly where are your
contact details though?
I used to be recommended this web site via my cousin. I am
not certain whether this put up is written by him as no one else understand such specific about my trouble.
You are amazing! Thank you!
Aw, this was a very good post. Taking a few minutes
and actual effort to create a good article… but what can I say… I put
things off a lot and never seem to get anything done.
This is a great tip particularly to those fresh to the blogosphere.
Brief but very accurate info… Many thanks for sharing this one.
A must read article!
I’m not sure where you are getting your info, but great topic.
I needs to spend some time learning more or understanding more.
Thanks for excellent information I was looking for this
info for my mission.
It’s difficult to find well-informed people on this topic, however, you sound like you know what you’re
talking about! Thanks
Hello, i believe that i saw you visited my weblog thus i came
to go back the prefer?.I’m attempting to in finding things to enhance my
site!I suppose its ok to make use of a few of your ideas!!
Hi! Someone in my Facebook group shared this website with us so I came to take a look.
I’m definitely enjoying the information. I’m bookmarking and will be
tweeting this to my followers! Exceptional blog and fantastic design.
Great beat ! I wish to apprentice at the same time as you amend your site, how can i subscribe for a blog site?
The account aided me a applicable deal. I had been a little bit acquainted of this your broadcast provided brilliant transparent concept
Greetings! Quick question that’s entirely off topic.
Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone4.
I’m trying to find a template or plugin that
might be able to resolve this issue. If you have any suggestions,
please share. Appreciate it!
I was recommended this web site by my cousin. I’m not
sure whether this post is written by him as no one else
know such detailed about my difficulty. You are amazing!
Thanks!
zithromax 100mg pills – cheap azithromycin 100mg zithromax without a script
Just wish to say your article is as astounding. The clarity to your put up
is just spectacular and that i could suppose you are an expert in this subject.
Well along with your permission allow me to clutch your RSS feed to keep
up to date with approaching post. Thanks a million and please carry on the rewarding work.
My brother recommended I may like this blog. He was totally right.
This publish truly made my day. You cann’t consider simply
how so much time I had spent for this info! Thanks!
cheap dapoxetine 30mg – oral dapoxetine 90mg prednisolone 10mg over the counter
Excellent post. I was checking continuously this blog and I’m impressed!
Extremely useful info particularly the remaining part
🙂 I maintain such info a lot. I used to be seeking this particular information for a long
time. Thank you and best of luck.
order synthroid 100mcg online cheap – coupon for cialis cialis 40mg cheap
order sildalis – sildalis oral order metformin 500mg sale
ampicillin 250mg pill – hydroxychloroquine 400mg pill cheap hydroxychloroquine 400mg
brand hydroxychloroquine – buy hydroxychloroquine 200mg online cheap order plaquenil 200mg generic
sildenafil 100mg us – buy generic cialis 40mg cialis daily
acheter 100mg sildenafil – sildenafil 50mg en ligne cialis 10mg sans ordonnance en france
buy prednisone 5mg – best drug for ed prednisone 40mg for sale
isotretinoin oral – amlodipine 5mg price amoxicillin 500mg price
cheap lyrica 150mg – zyrtec usa azithromycin pills
hi!,I like your writing so a lot! percentage we communicate more approximately
your post on AOL? I require a specialist on this area to unravel my problem.
Maybe that’s you! Taking a look ahead to peer you.
cenforce 100mg price – oral zovirax zovirax 800mg brand
Currently it seems like Movable Type is the preferred blogging platform out there right now.
(from what I’ve read) Is that what you are using on your blog?
canada generic tadalafil lowest price cialis
tizanidine 2mg sale – toradol generic buy generic colchicine
Very nice blog post. I certainly appreciate this site.
Keep it up!
Hi there! I understand this is sort of off-topic
however I needed to ask. Does running a well-established website
like yours take a lot of work? I’m completely new to blogging however
I do write in my diary every day. I’d like to start a blog so I will be able to
share my personal experience and views online. Please let me know if you have any kind of ideas or tips for brand new
aspiring blog owners. Appreciate it!
hydroxychloroquine pill – plaquenil 200mg oral order chloroquine pills
This text is priceless. How can I find out more?
What’s Taking place i am new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads.
I hope to contribute & help different users like its aided me.
Great job.
Fantastic blog! Do you have any helpful hints for aspiring writers?
I’m planning to start my own website soon but I’m a little
lost on everything. Would you advise starting with a
free platform like WordPress or go for a paid option? There are so
many options out there that I’m completely confused ..
Any suggestions? Thank you!
Just want to say your article is as amazing.
The clarity to your put up is simply cool and
that i could suppose you are a professional on this subject.
Fine together with your permission allow me to take hold of your feed to stay updated with coming near near post.
Thanks a million and please keep up the gratifying work.
tadalafil goodrx tadalafil daily online
Thanks for the auspicious writeup. It in truth used to be a entertainment account
it. Glance complex to more brought agreeable from you!
However, how can we keep in touch?
I blog quite often and I really appreciate your information. The article has truly peaked my
interest. I am going to bookmark your site and keep checking for new information about
once a week. I subscribed to your RSS feed too.
Definitely believe that that you stated. Your favorite justification appeared to be on the web
the easiest factor to have in mind of. I say to you, I definitely get annoyed
while folks consider issues that they plainly do not realize about.
You managed to hit the nail upon the highest and also
outlined out the entire thing with no need side-effects , people can take
a signal. Will probably be again to get more.
Thanks
I like the valuable info you provide for your articles.
I’ll bookmark your weblog and test once more right here
regularly. I am fairly certain I will learn plenty of new stuff proper right here!
Best of luck for the following!
Hello there! This is kind of off topic but I need some
help from an established blog. Is it difficult to set up your own blog?
I’m not very techincal but I can figure things out pretty quick.
I’m thinking about creating my own but I’m not sure
where to begin. Do you have any ideas or suggestions? Thank
you
I was suggested this website by my cousin. I am not sure whether this post is written by him as no
one else know such detailed about my trouble. You’re amazing!
Thanks!
Attractive element of content. I simply stumbled upon your site and in accession capital to claim that I acquire in fact loved account your weblog posts.
Any way I will be subscribing in your feeds or even I fulfillment you
get entry to persistently fast.
Fantastic website you have here but I was wondering if you knew of any discussion boards that cover the same topics talked about in this article?
I’d really like to be a part of online community where I can get feedback from
other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know.
Thank you!
I’d like to thank you for the efforts you’ve put in writing this blog.
I’m hoping to check out the same high-grade content from you in the future as well.
In truth, your creative writing abilities has
motivated me to get my own, personal website now
😉
prescription tadalafil online what is tadalafil
https://cialiswbtc.com/ tadalafil price walmart
https://cialistrxy.com/ cheap cialis pills for sale
I was curious if you ever thought of changing the layout of your website?
Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so
people could connect with it better. Youve
got an awful lot of text for only having one or 2 pictures.
Maybe you could space it out better?
Woah! I’m really loving the template/theme of this site.
It’s simple, yet effective. A lot of times it’s
tough to get that “perfect balance” between usability and appearance.
I must say you’ve done a superb job with this. In addition, the blog
loads super quick for me on Opera. Outstanding Blog!
I am truly glad to glance at this weblog posts which carries tons of helpful data,
thanks for providing these kinds of data.
It’s amazing designed for me to have a site, which is good in support of my know-how.
thanks admin
Howdy, i read your blog occasionally and i own a similar
one and i was just curious if you get a lot of spam remarks?
If so how do you protect against it, any plugin or anything you can recommend?
I get so much lately it’s driving me crazy
so any support is very much appreciated.
tadalafil 60 mg online
buy cialis pills cheapest tadalafil cost
cialis without a prescription buy generic cialis online with mastercard
Hey there! I know this is kind of off topic but I was wondering which blog platform are you using
for this site? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m
looking at alternatives for another platform.
I would be great if you could point me in the direction of a good platform.
It’s really a nice and helpful piece of info. I am happy that you shared this helpful info
with us. Please keep us informed like this. Thank you for sharing.
Wow, this post is fastidious, my younger sister is analyzing such things, thus I am going
to let know her.
I’m not certain where you are getting your info, however
great topic. I must spend a while learning more or working out
more. Thank you for magnificent information I was
looking for this info for my mission.
I’m gone to inform my little brother, that he should also visit this weblog
on regular basis to obtain updated from newest news update.
It’s very trouble-free to find out any matter on net as compared to textbooks, as I found this paragraph at this website.
Hmm is anyone else experiencing problems with the pictures on this blog loading?
I’m trying to find out if its a problem on my end or if
it’s the blog. Any feed-back would be greatly appreciated.
Right here is the right webpage for everyone who really wants to understand
this topic. You know a whole lot its almost hard to argue with you
(not that I really would want to…HaHa).
You certainly put a brand new spin on a topic that has been written about for decades.
Excellent stuff, just great!
Hi, its fastidious article about media print, we all be aware of media is a fantastic source of information.
My partner and I stumbled over here different web address and
thought I might as well check things out. I like what I see so now i am following you.
Look forward to looking over your web page for a second time.
Everyone loves what you guys are up too.
Such clever work and coverage! Keep up the amazing works guys I’ve included you guys to my blogroll.
I’m not sure why but this site is loading incredibly slow
for me. Is anyone else having this issue or is it a issue on my end?
I’ll check back later on and see if the problem still exists.
I really like your blog.. very nice colors & theme.
Did you make this website yourself or did you hire someone to do it for
you? Plz reply as I’m looking to create my own blog and would like to
know where u got this from. kudos
I’ve been surfing online more than three hours lately, but I never found any attention-grabbing article like yours.
It’s pretty value enough for me. Personally, if all website owners and
bloggers made excellent content as you did, the internet will probably be a lot
more helpful than ever before.
Very good article! We will be linking to this great article
on our website. Keep up the good writing.
continuously i used to read smaller posts which also
clear their motive, and that is also happening with this article which I am reading here.
Great site you’ve got here.. It’s difficult to find excellent writing like yours nowadays.
I honestly appreciate people like you! Take care!!
Hi, I think your website might be having browser compatibility issues.
When I look at your blog site in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that,
wonderful blog!
Hi there! This article couldn’t be written much better!
Going through this post reminds me of my previous roommate!
He continually kept talking about this. I am going to send
this information to him. Fairly certain he’s going to have a good read.
Thanks for sharing!
Heya exceptional blog! Does running a blog similar to this take a great
deal of work? I’ve absolutely no understanding of coding however I had been hoping to start my
own blog soon. Anyway, if you have any recommendations or techniques for new blog owners please share.
I know this is off topic but I just needed
to ask. Many thanks!
Magnificent web site. Plenty of helpful info here. I’m sending it to several buddies ans also sharing in delicious.
And naturally, thank you in your sweat!
I have been browsing on-line greater than three hours lately,
but I never found any interesting article like yours.
It’s lovely worth enough for me. In my view, if all site owners and bloggers
made good content as you probably did, the web can be much more useful
than ever before.
buy 12mg stromectol ivermectin tablets for sale canada price of stromectol absolute accuracy
https://ivermectinuni.com/ stromectol generic
buy stromectol 6 mg stromectol pills