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
buy medicines online in india indian pharmacy top 10 pharmacies in india
medication from mexico pharmacy: mexican pharma – mexican drugstore online
reputable mexican pharmacies online
mexican online pharmacies prescription drugs: mexico drug stores pharmacies – mexican pharmaceuticals online
“After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.
티비몬
I’ve been exploring for a bit for any high-quality articles
or blog posts on this sort of area . Exploring in Yahoo I eventually stumbled upon this web
site. Studying this info So i am happy to express that I have a very excellent uncanny
feeling I discovered exactly what I needed. I so much for
sure will make sure to do not put out of your mind this
site and give it a look regularly.
L Shape Single Beds Tools To Ease Your Daily Life L Shape Single Beds Trick Every Individual Should Know
l shaped single beds [Leilani]
buying prescription drugs in mexico online: mexican mail order pharmacies – buying from online mexican pharmacy
mexico pharmacies prescription drugs: medication from mexico – mexico drug stores pharmacies
mexican drugstore online
https://canadapharma.shop/# best canadian pharmacy online
What’s up, its pleasant paragraph regarding media print, we all understand media is a
great source of data.
My homepage: HD Foundations Inc.
First of all I would like to say awesome blog! I had a quick question in which I’d like to ask if you don’t mind.
I was interested to know how you center yourself and
clear your mind before writing. I’ve had a hard time clearing my thoughts in getting my ideas out there.
I truly do enjoy writing however it just seems like the first 10 to
15 minutes tend to be lost just trying to figure out how
to begin. Any ideas or tips? Thank you!
https://mexicanpharma.icu/# mexican rx online
Excellent write-up. I definitely love this website.
Thanks!
Overview
In a society that transforms at rapid speed, the ability to create isn’t just advantageous—it’s crucial. Whether you’re an founder, a company leader, or a programmer, staying in the lead requires an innovative mindset. This blog post will explore the notion of innovation, uncovering what it takes to be a real innovator and why it’s more significant now than ever. You’ll learn characteristics that distinguish successful innovators, discover motivating case studies, and gain practical strategies for fostering your own innovative thinking.
What is Innovation and Why Does it Matter?
Innovation is more than just a term; it’s the lifeblood of development. It involves creating new ideas or enhancing existing ones, leading to tangible benefits. In today’s fast-paced environment, businesses must innovate to thrive and flourish. Innovation propels effectiveness, enhances customer experience, and opens new earning streams. Without it, inactivity is inevitable.
Traits of a True Innovator
Creativity
https://open.spotify.com/user/315dinldrfeteavaw5odm2f4cq6i
At the center of innovation is creativity. This trait allows individuals to think beyond the limits the box, generating distinct solutions to difficult problems. Innovative thinking can be cultivated by exposing oneself to diverse perspectives and experiences.
Adaptability
In a rapidly changing world, an innovator must be adaptable. Being able to adjust when faced with new obstacles or opportunities is essential. Adaptability assures that you can progress alongside market shifts and technological advancements.
Risk-Taking
Innovation often requires venturing into the uncertain. True innovators are willing to take measured risks. They understand that failure is a part of the path and use it as a learning tool to enhance their ideas.
Case Studies of Successful Innovators
Elon Musk
Elon Musk’s groundbreaking ventures, from Tesla to SpaceX, have transformed industries. His preparedness to tackle huge technological challenges and alter established markets showcases the strength of a bold vision.
Sara Blakely
Sara Blakely, the creator of Spanx, turned a straightforward idea into a billion-dollar conglomerate. Her innovation in the clothing industry demonstrates how solving everyday issues can lead to extraordinary success.
Steve Jobs
Steve Jobs’ relentless pursuit of innovation transformed Apple into a global tech giant. His focus on aesthetics and user interaction set new standards for the industry, proving that innovation can be a key advantage.
Fostering an Innovative Mindset
Encourage a Culture of Openness
Creating an setting where new ideas are welcomed and valued is crucial. Organizations should support employees to share their ideas without fear of judgment. This openness fosters cooperation and sparks creativity.
Learn from Failure
Failure is an inevitable part of the innovation journey. Instead of fearing it, innovators should view failure as an opportunity to learn and grow. Examining what went wrong and why can provide valuable lessons for future efforts.
Embrace New Technologies
Digital advancements offer endless potential for innovation. Staying informed with the latest developments and tools can provide a competitive edge. Whether it’s AI, blockchain, or IoT, leveraging new technologies can lead to significant breakthroughs.
The Role of Innovation in Business Growth
Driving Efficiency
Innovative approaches can streamline operations, reducing costs and enhancing efficiency. Automation and digital transformation are instances of how businesses can innovate to enhance productivity.
Enhancing Customer Experience
Innovation can significantly improve customer experience. By understanding customer demands and developing tailored solutions, businesses can foster loyalty and drive growth. Tailored services and innovative products can set a company apart from its peers.
Opening New Revenue Streams
Innovative thinking can uncover new business opportunities. Diversifying product lines, entering new fields, 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 traits of true innovators, learning from successful case studies, and fostering an innovative mindset, you can unlock your creative potential. Remember, innovation isn’t just about revolutionary inventions; it’s about making continuous 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 creative journey.
Excellent beat ! I would like to apprentice even as you
amend your website, how could i subscribe for a weblog website?
The account aided me a acceptable deal. I have been tiny bit familiar of this your
broadcast offered brilliant transparent concept
mexican border pharmacies shipping to usa medication from mexico п»їbest mexican online pharmacies
15 Unexpected Facts About ADHD Test The Words
You’ve Never Learned Adhd Online Test Adults (Trade-Britanica.Trade)
You’ll Never Be Able To Figure Out This Private Psychiatrists Near Me’s Secrets private Psychiatrists Near me
п»їlegitimate online pharmacies india indian pharmacy cheapest online pharmacy india
best mail order pharmacy canada Canadian Pharmacy canadian pharmacy reviews
Hello! 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. Nonetheless, I’m definitely happy I found it and I’ll
be book-marking and checking back frequently!
Feel free to surf to my page foundation repair
Introduction
In a world that transforms at incredible speed, the skill to innovate isn’t just helpful—it’s essential. Whether you’re an founder, a business leader, or a programmer, staying ahead requires an innovative mindset. This blog post will investigate the notion of innovation, uncovering what it takes to be a real innovator and why it’s more important now than ever. You’ll learn qualities that distinguish successful innovators, discover encouraging case studies, and gain usable strategies for fostering your own original thinking.
What is Innovation and Why Does it Matter?
Innovation is more than just a catchphrase; it’s the essence of progress. It requires creating new ideas or enhancing existing ones, leading to tangible benefits. In today’s fast-paced environment, businesses must innovate to exist and prosper. Innovation fuels effectiveness, enhances customer interaction, and opens new revenue streams. Without it, stagnation is inevitable.
Traits of a True Innovator
Creativity
https://open.spotify.com/user/315dinldrfeteavaw5odm2f4cq6i
At the core of innovation is creativity. This trait allows individuals to think beyond the box, generating original solutions to complex problems. Imaginative thinking can be fostered by exposing oneself to diverse perspectives and viewpoints.
Adaptability
In a rapidly changing world, an innovator must be adaptable. Being able to pivot when faced with new hurdles or opportunities is crucial. Adaptability ensures that you can evolve alongside market shifts and digital advancements.
Risk-Taking
Innovation often involves venturing into the uncertain. True innovators are willing to take calculated risks. They know that failure is a part of the path and use it as a growth tool to enhance their ideas.
Case Studies of Successful Innovators
Elon Musk
Elon Musk’s innovative ventures, from Tesla to SpaceX, have transformed industries. His willingness to tackle enormous technological challenges and shake up established markets showcases the power of a bold vision.
Sara Blakely
Sara Blakely, the creator of Spanx, turned a basic idea into a billion-dollar business. Her innovation in the clothing industry demonstrates how solving everyday issues can lead to exceptional success.
Steve Jobs
Steve Jobs’ unyielding pursuit of innovation transformed Apple into a international tech giant. His focus on appearance and user interaction set new standards for the industry, proving that innovation can be a key differentiator.
Fostering an Innovative Mindset
Encourage a Culture of Openness
Creating an environment where new ideas are welcomed and valued is crucial. Organizations should encourage employees to share their opinions without fear of judgment. This openness fosters teamwork and sparks creativity.
Learn from Failure
Failure is an unavoidable part of the innovation journey. Instead of dreading it, innovators should view failure as an opportunity to learn and grow. Analyzing what went wrong and why can provide valuable insights for future endeavors.
Embrace New Technologies
Technological advancements offer endless possibilities for innovation. Staying updated with the latest advancements and tools can provide a competitive edge. Whether it’s AI, blockchain, or IoT, leveraging new technologies can lead to significant breakthroughs.
The Role of Innovation in Business Growth
Driving Efficiency
Innovative approaches can streamline operations, reducing costs and enhancing efficiency. Automation and digital evolution are instances of how businesses can innovate to enhance productivity.
Enhancing Customer Experience
Innovation can significantly improve customer interaction. By understanding customer needs and developing personalized solutions, businesses can foster loyalty and drive growth. Tailored services and innovative products can set a company apart from its competitors.
Opening New Revenue Streams
Innovative thinking can uncover new enterprise opportunities. Diversifying product lines, entering new sectors, or developing unique services can open new revenue streams. This expansion mitigates risk and promotes sustainable growth.
Conclusion
Innovation is the driving force behind progress in today’s dynamic world. By understanding the qualities of true innovators, learning from effective case studies, and fostering an innovative mindset, you can unlock your inventive potential. Remember, innovation isn’t just about groundbreaking inventions; it’s about making ongoing 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 creative journey.
mexico drug stores pharmacies: mexico drug stores pharmacies – buying from online mexican pharmacy
india pharmacy mail order: indian pharmacy – п»їlegitimate online pharmacies india
Adhd Symptoms Adults Test: What’s The Only Thing Nobody Is Talking About Symptoms Of Adhd In Adults Quiz
Сервисный центр предлагает ремонт телефонов maxvi в москве ремонт телефона maxvi рядом
A Guide To Treehouse Canopy From Beginning To End Treehouse Beds
Online medicine order: Indian pharmacy online – п»їlegitimate online pharmacies india
medicine in mexico pharmacies: pharmacies in mexico that ship to usa – п»їbest mexican online pharmacies
medication from mexico pharmacy
4 Dirty Little Details About Situs Togel Terpercaya And The Situs Togel Terpercaya Industry Togel Resmi Indonesia