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
pharmacies en ligne certifiГ©es: pharmacie en ligne pas cher – acheter mГ©dicament en ligne sans ordonnance
buying prescription drugs in mexico: mexican rx online – mexican online pharmacies prescription drugs
medication from mexico pharmacy
Профессиональный сервисный центр по ремонту объетивов в Москве.
Мы предлагаем: замена объектива фотоаппарата
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
Achat mГ©dicament en ligne fiable: Cialis generique prix – pharmacie en ligne avec ordonnance
11 Creative Methods To Write About Pods Coffee Machine best coffee pod machine
(Etta)
What You Need To Do With This Diagnose ADHD how to diagnose adhd in adults (Brigette)
I like the helpful info you provide in your articles.
I will bookmark your blog and check again here frequently.
I am quite sure I’ll learn plenty of new stuff right here!
Good luck for the next!
mexican border pharmacies shipping to usa: medication from mexico – buying from online mexican pharmacy
mexico drug stores pharmacies
“I am a normal visitor of your web site and appreciate you taking the time to maintain the excellent site. I will be a frequent visitor for a long time.
“늑대닷컴
Viagra femme sans ordonnance 24h Viagra pas cher paris Viagra homme prix en pharmacie sans ordonnance
https://clssansordonnance.icu/# Pharmacie sans ordonnance
Viagra homme prix en pharmacie sans ordonnance: viagra sans ordonnance – Viagra gГ©nГ©rique sans ordonnance en pharmacie
http://pharmaciepascher.pro/# Pharmacie en ligne livraison Europe
Introduction
In a world that transforms at incredible speed, the ability to develop isn’t just advantageous—it’s essential. Whether you’re an founder, a corporate leader, or a developer, staying at the forefront requires an innovative mindset. This blog post will investigate the idea of innovation, uncovering what it takes to be a true innovator and why it’s more significant now than ever. You’ll learn qualities that distinguish successful innovators, discover inspiring case studies, and gain practical strategies for fostering your own creative thinking.
What is Innovation and Why Does it Matter?
Innovation is more than just a catchphrase; it’s the essence of development. It entails creating new ideas or enhancing existing ones, leading to tangible benefits. In today’s quick environment, businesses must innovate to thrive and prosper. Innovation drives effectiveness, enhances customer satisfaction, and opens new revenue streams. Without it, standstill is inevitable.
Traits of a True Innovator
Creativity
https://ko-fi.com/rileyreesepurdue
At the core of innovation is creativity. This quality allows individuals to think outside the box, generating original solutions to complicated problems. Innovative thinking can be nurtured by introducing oneself to diverse perspectives and experiences.
Adaptability
In a rapidly changing world, an innovator must be adaptable. Being able to pivot when faced with new hurdles or opportunities is essential. Adaptability assures that you can progress alongside market trends and technological advancements.
Risk-Taking
Innovation often involves venturing into the unexplored. True innovators are willing to take thought-out risks. They recognize that failure is a part of the journey and use it as a educational tool to improve their ideas.
Case Studies of Successful Innovators
Elon Musk
Elon Musk’s groundbreaking ventures, from Tesla to SpaceX, have revolutionized industries. His willingness to tackle huge technological challenges and alter established markets showcases the power of a bold vision.
Sara Blakely
Sara Blakely, the founder of Spanx, turned a straightforward idea into a billion-dollar conglomerate. Her innovation in the fashion industry demonstrates how solving everyday issues can lead to extraordinary success.
Steve Jobs
Steve Jobs’ unyielding pursuit of innovation transformed Apple into a worldwide tech giant. His focus on appearance and user satisfaction set new benchmarks for the industry, proving that innovation can be a key advantage.
Fostering an Innovative Mindset
Encourage a Culture of Openness
Creating an environment where new ideas are embraced and valued is essential. Organizations should promote employees to share their opinions without fear of judgment. This openness fosters cooperation and sparks creativity.
Learn from Failure
Failure is an inevitable part of the innovation process. Instead of fearing it, innovators should view failure as an opportunity to learn and grow. Reviewing what went wrong and why can provide valuable understandings for future endeavors.
Embrace New Technologies
Technological advancements offer endless potential for innovation. Staying informed with the latest trends and tools can provide a competitive edge. Whether it’s AI, blockchain, or IoT, leveraging new technologies can drive significant breakthroughs.
The Role of Innovation in Business Growth
Driving Efficiency
Innovative approaches can streamline operations, reducing costs and boosting efficiency. Automation and digital evolution are instances of how businesses can innovate to enhance productivity.
Enhancing Customer Experience
Innovation can significantly improve customer satisfaction. By understanding customer requirements and developing tailored solutions, businesses can foster loyalty and encourage growth. Customized services and innovative products can set a company apart from its peers.
Opening New Revenue Streams
Innovative thinking can uncover new commercial opportunities. Diversifying product lines, entering new markets, or developing unique services can open new revenue streams. This expansion mitigates risk and promotes sustainable growth.
Conclusion
Innovation is the driving force behind success in today’s dynamic world. By understanding the characteristics of true innovators, learning from proven case studies, and fostering an innovative mindset, you can unlock your original potential. Remember, innovation isn’t just about revolutionary inventions; it’s about making constant improvements that add value. Whether you’re leading a team or pursuing personal projects, the ability to innovate will set you apart and drive your success. Now, it’s time to put these insights into action and start your own innovative journey.
Wonderful piece, it was really helpful. Thanks for sharing!
Can’t wait to see more content from you.|
This was a great article, it’s really helpful and
detailed. Looking forward to more from you.|
What an informative article, This deserves to be shared.
Thanks a lot!|
Loved the content, it was very detailed. Looking forward
to future posts. Fantastic work.|
I found this really helpful. Your suggestions were spot on. I’ll definitely implement them.
Thanks for sharing!|
Very informative write-up, I got a lot out of it.
I’ll definitely come back. Keep writing awesome content.|
See What Double Glazed Sash Windows Tricks The Celebs Are Using double glazed sash window
How Situs Terpercaya Arose To Be The Top Trend In Social Media toto macau (Everette)
I have read so many articles about the blogger lovers but this piece of writing is truly a pleasant post, keep it up.
Incredible story there. What occurred after?
Thanks!
Pharmacie sans ordonnance Cialis sans ordonnance 24h pharmacies en ligne certifiГ©es
medication from mexico pharmacy: buying prescription drugs in mexico – medication from mexico pharmacy
medication from mexico pharmacy
The Top Reasons Why People Succeed In The Key Fob Programming Near Me Industry key Reprogramming
A Help Guide To Kids Triple Bunk Beds From Beginning To End triple bunk beds for kids (Adolfo)
https://sitepak.polri.go.id
MEMEK BAJINGAN
https://zeykotarim.com
MEMEK BIADAB
https://990qr.com
KONTOL BAJINGAN
https://budgetngbayan.com
KONTOL BIADAB
Фабрика кашеварных гарнитуров на Санкт-петербурге – это чемодан фундаментальный участник на учреждении кухонных интерьеров. Ты да я специализируемся на исследованию, изготовлении также аппарате первоклассных кухонных гарнитуров, кои соединяют в течение себе стиль, работоспособность равно долговечность. Наша послание – позволить клиентам субъективные заключения, разработанные один-два учётом ихний пожеланий и еще надобностей, чтобы любая кухня стала уютным равно удобным районом чтобы бытие а также творчества http://www.tivokya0kuhnishki.ru.
I do not know whether it’s just me or if everybody else experiencing issues with
your site. It looks like some of the text in your posts are running off the screen. Can somebody else please
provide feedback and let me know if this is happening to them as well?
This could be a issue with my browser because I’ve had
this happen before. Cheers
You actually suggested it exceptionally well.