Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div style="float:left; width:49%; border:1px dashed gray;">
	<h1>Sırasız Dizi</h1>
	<div id="sirasiz" style="">
		
	</div>
</div>
<div style="float:left; width:49%; border:1px dashed gray;">
	<h1>Adede göre sıralı dizi</h1>
	<h2 style="float:left; width:50%;">ASC</h2>
	<h2 style="float:left; width:50%;">DESC</h2>

	<div id="asc" style="float:left; width:50%;">
		
	</div>
	<div id="desc" style="float:left; width:50%;">
		
	</div>
</div>

              
            
!

CSS

              
                
              
            
!

JS

              
                
			function listArray(arr,order){
			
				// dizideki tekrar eden elemanları sayı adedine toplayıp yeni obj olusturuyoruz
				var itemCount = [];
				arr.forEach(function (x) { itemCount[x] = (itemCount[x] || 0) + 1; });
				
				// olusturdugumuz objeyi ters siralamak icin diziye donusturuyoruz.
				var countsSortable = [];
				for (var i in itemCount) {
					countsSortable.push([ itemCount[i],i])
				}
						
				countsSortable.sort(function (a, b) {
					if(order === 'desc')
					{
						return b[0] - a[0];
					} else {
						return a[0] - b[0];
					}
				});
				
				return countsSortable;
					
			}
			
			var fruits = ["Karpuz","Armut","Ekşi elma","Limon","Armut","Çilek","Çilek","Karpuz","Kiraz","Greyfurt","Beyaz üzüm","Muz","Greyfurt","Karpuz","Muz","Portakal","Nar","Karpuz","Armut","Kara üzüm","Greyfurt","Çilek","Greyfurt","Beyaz üzüm","Muz","Muz","Greyfurt","Muz","Greyfurt","Çilek","Muz","Armut","Nar","Çilek","Armut","Karpuz","Çilek","Elma","Portakal","Nar","Nar","Karpuz","Greyfurt","Karpuz","Greyfurt","Çilek","Beyaz üzüm","Karpuz","Nar","Ekşi elma","Ekşi elma","Nar","Ekşi elma","Ekşi elma","Ekşi elma","Muz","Karpuz","Limon","Nar","Armut","Ekşi elma","Greyfurt","Beyaz üzüm","Armut","Kara üzüm","Muz","Ekşi elma","Portakal","Muz","Karpuz","Muz","Beyaz üzüm","Karpuz","Kara üzüm","Kiraz","Çilek","Elma","Beyaz üzüm","Beyaz üzüm","Beyaz üzüm","Armut","Elma","Portakal","Kara üzüm","Kiraz","Limon","Kiraz","Nar","Ekşi elma","Karpuz","Çilek","Çilek","Ekşi elma","Kiraz","Elma","Greyfurt","Çilek","Kara üzüm","Armut","Karpuz"];
			
			//yazdirma
			document.getElementById('sirasiz').innerHTML = fruits.join("<br>");
			document.getElementById('asc').innerHTML = listArray(fruits,'asc').join("<br>");
			document.getElementById('desc').innerHTML = listArray(fruits,'desc').join("<br>");
              
            
!
999px

Console