JS 依照元素出現數量排序
同樣是最近遇到的狀況,需要利用陣列內元素出現的數量進行排序,以下為範例程式:
var array = ["1", "2", "4", "5", "2", "4", "2", "3"]; var str = array.toString(); var filter = []; var result = []; document.write("原始陣列:" + array + "<br>"); var get = function (str, tar, arr, tmp) { if (str.indexOf(tar) >= 0) { tmp = str.slice(str.indexOf(tar) + 1); arr.push(tar); get(tmp, tar, arr, tmp); } return arr; } for (i in array) { var elm = []; var tmp; var fstr = filter.join(); if (fstr.indexOf(array[i]) >= 0) { continue; } else { var tmp_arr = get(str, array[i], elm, tmp); result.push(tmp_arr.length + ':' + tmp_arr[0]); filter.push(array[i]); } } result.sort(); result.reverse(); //按照出現次數排序,不刪除重複元素 var finishArray = []; for (index in result) { var show = result[index].split(':'); for (i = 0; i < show[0]; i++) { finishArray.push(show[1]); } } document.write("按出現次數排序,不刪除重複元素:" + finishArray + "<br>"); //按照出現次數排序,刪除重複元素 var finishArray = []; for (index in result) { var show = result[index].split(':'); finishArray.push(show[1]); } document.write("按出現次數排序,刪除重複元素:" + finishArray + "<br>");
輸出結果:
原始陣列:1,2,4,5,2,4,2,3 按出現次數排序,不刪除重複元素:2,2,2,4,4,5,3,1 按出現次數排序,刪除重複元素:2,4,5,3,1
Useful data. Thanks a lot.
canada pharmaceuticals online https://sopharmsn.com/ on line pharmacy
Профессиональная выездная химчистка мягкой мебели и ковров в Краснодаре и крае химчистка ковров в краснодаре
https://buyprednisone.store/# prednisone 30 mg tablet
I just could not gⲟ away yօur site before suggesting tһat I actᥙally
loved thе usual info аn individual supply on yοur guests?
Is gonna be aցain often to inspect new posts
Check оut my blog :: lotto (Hortense)
prednisone 5mg capsules: prednisone 20mg tablets where to buy – generic prednisone otc
On the highway, the two stake the guards traveling with them.
He orders two guards to take Jessica and watch her sire Jason. Jason and Sookie share a
teary goodbye. Jessica updates Jason: Sookie is in hazard and no just one is trying to preserve her.
Jessica adds that she would have been happy to commit eternity with Jason, but he
is in no temper to listen. Having faked unconsciousness, Jason swings into action when Jessica alerts him that
he guards have relaxed, and he shoots them with
wood bullets. I will have the solar," he proclaims and leaves.
Spooked, Bill leaves the space but in turning again,
places a bloody handprint on the glass case.
Bill hears a voice drawing him into the Blood Shrine. Bill catches Jessica striving to use
his mobile mobile phone to call and warn Jason about Steve Newlin.
Use your instincts, what you know about your sector, the encounter of your
profits team, and the power of your promoting application to occur up with an educated
guess for your sales forecasts. Roffee argues that the use of certain language in the
legislation about these familial sexual routines manipulates
the reader to watch it as immoral and criminal, even if all
get-togethers are consenting.
Here is my page … Porn Site Free
http://amoxil.cheap/# buy amoxicillin 250mg
stromectol drug: ivermectin 0.1 – ivermectin 3mg tab
Your Comprehensive Manual to Rain Gutter Installation, Gutter Guard Installation, and Rain Gutter Cleansing Assistance
If you’re an owner of a house, one comprehend the importance of maintaining a functional rain gutter system. Gutters play a crucial role in safeguarding your house from water harm by channeling water from rainfall away from the roof and base. However, making sure your gutters are in top shape requires more than just occasional cleansing. From gutter installation to rain gutter protector setting up and gutter cleaning services, this complete guide covers everything you need to know to keep your gutters in optimal condition.
Rain Gutter Installation
Why Gutters Are Important
Before we dive into rain gutter setting up, let’s understand why rain gutters are essential for your home. Gutters aid avert water damage by directing water from rainfall away from your home’s base, walls, and landscaping. Without adequate water drainage, water runoff can lead to wear and tear, basement flooding, mold growth, and constructional harm.
Signs You Need New Gutters
Cracks or Rust: Visible cracks or rust spots suggest that your rain gutters are deteriorating and may require to be replaced.
Sagging or Pulling Away: Gutters that sag or pull away from the home are not efficiently directing rainwater away and should be replaced.
Water Damage: Water stains on the exterior of your house or basement flooding may suggest that your gutters are not functioning properly to do their job.
Frequent Clogs: If your rain gutters are continuously clogged with debris, it may be time to invest in an updated gutter system that is easier to maintain.
Gutter Materials
When it comes to rain gutter materials, one have numerous options to choose from:
Aluminum: Lightweight, rust-resistant, and accessible in a variety of colors.
Vinyl: Affordable, easy to set up, and low maintenance.
Steel: Durable and suitable for regions with harsh weather conditions.
Copper: Elegant, long-lasting, and adds a decorative touch to your house.
DIY vs. Professional Setting up
While some house owners might try to set up rain gutters themselves, it’s often preferable to leave this job to the professionals. Professional gutter installers have the experience, tools, and expertise to ensure that your rain gutters are installed correctly and operate optimally. Plus, hiring a professional can save you time and hassle in the long run.
Rain Gutter Guard Setting up
The Importance of Rain Gutter Guards
Gutter guards are an important addition to any gutter system. These protective covers stop leaves, twigs, and debris from clogging your gutters, reducing the requirement for frequent cleaning and reducing the risk of water damage to your home.
Types of Rain Gutter Guards
Mesh Screens: Fine mesh screens permit water to flow through while blocking debris.
Reverse Curve: These gutter guards feature a curved surface that directs water into the gutter while preventing leaves and debris from entering.
Brush Inserts: Brush-style inserts fit inside the gutter and prevent leaves from accumulating while allowing water to flow freely.
Foam Inserts: Foam rain gutter guards block debris while allowing water to filter through.
Professional Setting up vs. DIY
While some house owners may attempt to set up gutter guards themselves, professional installation is often recommended. Professional installers can ensure that gutter guards are properly fitted and securely attached, reducing the risk of debris buildup and water damage.
Rain Gutter Cleaning Services
The Importance of Rain Gutter Cleaning
Regular gutter cleaning is essential for maintaining a functional rain gutter system. Over time, leaves, twigs, and debris can accumulate in your rain gutters, resulting to clogs and water overflow. Professional rain gutter cleaning services can help prevent these issues and extend the life of your gutters.
Signs You Need Gutter Cleaning
Visible Debris: If you notice leaves, twigs, or other debris in your gutters, it’s time for a cleansing.
Water Overflow: Overflowing gutters during rainstorms indicate that they are clogged and need to be cleaned.
Sagging Rain Gutters: Rain gutters that sag or pull away from the house might be weighed down by debris and need cleaning.
<a href=https://www.tiktok.com/@jgutterguardsGutter installation
Frequency of Rain Gutter Cleaning
The frequency of rain gutter cleaning depends on several factors, including the surrounding vegetation, climate, and gutter guard installation. In general, it’s recommended to clean your gutters at least twice a year, ideally in the spring and fall, to remove seasonal debris buildup.
Conclusion
Maintaining a functional rain gutter system is essential for shielding your house from water damage and preserving its structural integrity. Whether you require rain gutter installation, gutter guard installation, or rain gutter cleaning assistance, investing in professional assistance can save you time, money, and hassle in the long run. By prioritizing gutter, you can ensure that your home remains safe, dry, and secured for years to come.
lasix side effects Buy Lasix lasix generic name
lasix lasix 100 mg tablet furosemide 40 mg
semaglutide 14mg
Hello there! I could have sworn I’ve been to this website before but after browsing
through some of the post I realized it’s new
to me. Anyways, I’m definitely happy I found it and I’ll be book-marking and checking
back often!
Also visit my website … خرید بک لینک
buy prednisone canadian pharmacy: 80 mg prednisone daily – prednisone 2.5 tablet
https://amoxil.cheap/# amoxicillin without a doctors prescription
price for 15 prednisone where to buy prednisone 20mg where can i buy prednisone without prescription
Профессиональная выездная химчистка мягкой мебели и ковров в Краснодаре и крае химчистка мебели краснодар
ivermectin lotion price order stromectol stromectol buy uk
lisinopril prescription: lisinopril metoprolol – lisinopril over the counter
What’s up colleagues, its fantastic article concerning tutoringand completely defined, keep it up all the time.
http://furosemide.guru/# furosemida
lasix 100 mg Buy Lasix lasix side effects
This page truly hɑs ɑll tһe info І needed concerning tһіѕ subject and dіdn’t know who
to ask.
Look at my webpage; lotto
ivermectin 3mg pill: ivermectin iv – stromectol tablets buy online
Hi! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having difficulty
finding one? Thanks a lot!
lisinopril 90 pills cost: buy lisinopril without prescription – lisinopril 20 25 mg tab
After selecting our four favorite Ashley Graham looks, we have pinpointed two key attributes to look for. First, a high-waist fit is always flattering. The silhouette elongates your legs and shows off your waist. Secondly, Graham is a big fan of midi dresses. She styles her midi-length dress with minimalist stilettos and a statement coat. Below, check out four different plus-size party outfits brought to you by Ashley Graham. Every woman wants to feel absolutely gorgeous regardless of the occasion and part of that feeling is attributed to the hair. Think of the event you’ll be attending when choosing a hairstyle. Weddings often call for bridesmaids or other participants to have elaborate hairstyles created, while more standard parties might allow loose and luscious locks that hang over your shoulders. Let yourself be inspired by your dress and the season and make sure that this is reflected in your choice of hairstyle. Your makeup should also enhance, not mask your beautiful features.
http://mayfever.crowdfundhq.com/users/fashionspain
Easter is the perfect time to wear your favorite pastel shades. This soft purple midi dress features the quintessential Easter seersucker pattern as well as lace trim and ruffles. Oh, and we should mention it has pockets! You can of course wear simple, basic makeup for Easter, or you can try something like these! Pastel colors in pinks, blues, and purples are perfect for Easter. Try a wash of pink, pastel blue or purple eye shadow (or a mix of these!). Or try royal blue or light turquoise eyeliner. Many believe that religion has a role in Easter attire. Many people were baptized during Easter and wore new, white robes to symbolize new life. Hall said she dresses up for every church service, but she said anyone can wear anything to any church service regardless of the Easter holiday.
Keep on working, great job!
Good day I am so grateful I found your blog page, I really found you by accident, while I was searching on Bing for something else, Regardless I
am here now and would just like to say many thanks for a marvelous post and a all
round interesting blog (I also love the theme/design), I don’t have time to
go through it all at the minute but I have saved it and
also added in your RSS feeds, so when I have time I will be back to read more, Please do keep up the excellent
work.
Feel free to visit my blog post :: http://top.stargardzki.stargard.pl
An interesting discussion is definitely worth comment. I believe that you need to publish more on this topic, it
might not be a taboo matter but generally people don’t talk
about such subjects. To the next! Kind regards!!