<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SEO, Web Tasarım, Kodlama ve Wordpress ile ilgili yazılar | Aykan Burçak</title>
	<atom:link href="https://www.aykanburcak.com/en/yazilar/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.aykanburcak.com/en/yazilar/</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2023 09:37:21 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3.8</generator>
	<item>
		<title>How to use reduce() function in Javascript</title>
		<link>https://www.aykanburcak.com/en/yazilar/how-to-use-reduce-function-in-javascript/</link>
		
		<dc:creator><![CDATA[aykanburcak]]></dc:creator>
		<pubDate>Mon, 02 Jan 2023 09:24:57 +0000</pubDate>
				<category><![CDATA[Frontend Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">https://www.aykanburcak.com/?post_type=lastposts&#038;p=1278</guid>

					<description><![CDATA[<p>The reduce() function is a powerful tool in JavaScript that allows you to iterate...</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-use-reduce-function-in-javascript/">How to use reduce() function in Javascript</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <code>reduce()</code> function is a powerful tool in JavaScript that allows you to iterate over an array and reduce the values to a single output. It can be used to perform a variety of tasks, such as calculating the sum of an array of numbers, finding the maximum value in an array, or even flattening an array of arrays.</p>
<p>To use the <code>reduce()</code> function, you need to pass it a callback function that will be called for each element in the array. This callback function should take two arguments: the previous value and the current value. The <code>reduce()</code> function will then apply this callback function to each element in the array, starting from the left, and return the final result.</p>
<p>Here is an example of using the <code>reduce()</code> function to calculate the sum of an array of numbers:</p>
<pre>
<code class="javascript">
const numbers = [1, 2, 3, 4, 5];

const sum = numbers.reduce((prev, curr) =&gt; prev + curr);

console.log(sum); // 15
</code>
</pre>
<p>In this example, the callback function passed to reduce() simply adds the previous value to the current value and returns the result. The reduce() function starts by setting the previous value to the first element in the array (1) and the current value to the second element (2). It then applies the callback function to these values and sets the previous value to the result (3). It continues this process until it reaches the end of the array, at which point it returns the final result (15).</p>
<p>You can also specify an initial value as the second argument to the reduce() function. This initial value will be used as the previous value in the first iteration. For example:</p>
<pre>
<code class="javascript">
const numbers = [1, 2, 3, 4, 5];

const sum = numbers.reduce((prev, curr) =&gt; prev + curr, 10);

console.log(sum); // 25
</code>
</pre>
<p>In this case, the reduce() function will start by setting the previous value to the initial value of 10 and the current value to the first element in the array (1). It will then apply the callback function to these values and set the previous value to the result (11). It will continue this process until it reaches the end of the array, at which point it will return the final result (25).</p>
<p>The reduce() function can also be used to perform more complex tasks, such as finding the maximum value in an array or flattening an array of arrays. For example:</p>
<pre>
<code class="javascript">
const numbers = [1, 2, 3, 4, 5];

const max = numbers.reduce((prev, curr) =&gt; Math.max(prev, curr));

console.log(max); // 5

const nestedArray = [[1, 2], [3, 4], [5, 6]];

const flatten = nestedArray.reduce((prev, curr) =&gt; prev.concat(curr), []);

console.log(flatten); // [1, 2, 3, 4, 5, 6]
</code>
</pre>
<p>In the first example, the callback function passed to reduce() uses the Math.max() function to find the maximum value in the array. In the second example, the callback function uses the concat() method to flatten the array.</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-use-reduce-function-in-javascript/">How to use reduce() function in Javascript</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to add new property in array of objects using JavaScript</title>
		<link>https://www.aykanburcak.com/en/yazilar/how-to-add-new-property-in-array-of-objects-using-javascript/</link>
		
		<dc:creator><![CDATA[aykanburcak]]></dc:creator>
		<pubDate>Sun, 02 May 2021 12:28:45 +0000</pubDate>
				<category><![CDATA[Frontend Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">https://www.aykanburcak.com/?post_type=lastposts&#038;p=1258</guid>

					<description><![CDATA[<p>Sometimes we need to modify some arrays for tons of possible reasons. Let me...</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-add-new-property-in-array-of-objects-using-javascript/">How to add new property in array of objects using JavaScript</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></description>
										<content:encoded><![CDATA[<p data-height="318" data-theme-id="10798" data-default-tab="js,result" data-user="aykanburcak" data-slug-hash="OJWKPoe" data-pen-title="JavaScript map()">Sometimes we need to modify some arrays for tons of possible reasons.<br />
Let me give you a real-world example.</p>
<p data-height="318" data-theme-id="10798" data-default-tab="js,result" data-user="aykanburcak" data-slug-hash="OJWKPoe" data-pen-title="JavaScript map()">Think about you&#8217;re working on a Vue.js project and your task is creating a tabs navigation.<br />
You sent the request to the endpoint and got a response like this:</p>
<pre><code class="javascript">[
  {
    id: 1,
    title: 'Some title',
    content: 'Some content',
  },
  {
    id: 2,
    title: 'Some title',
    content: 'Some content',
  },
  {
    id: 3,
    title: 'Some title',
    content: 'Some content',
  },
  {
    id: 4,
    title: 'Some title',
    content: 'Some content',
  }
]
</code>
</pre>
<p>First of all, you need some kind of property in this objects of array, like &#8220;isActive&#8221; to show or hide the corresponding tab based on this property value.<br />
The easiest and shortest thing you can do is using map() function and modify every object in the array.<br />
<iframe height="500" style="width: 100%;" scrolling="no" title="JavaScript map()" src="https://codepen.io/aykanburcak/embed/OJWKPoe?height=500&#038;theme-id=10798&#038;default-tab=js,result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"><br />
  See the Pen <a href='https://codepen.io/aykanburcak/pen/OJWKPoe'>JavaScript map()</a> by Aykan<br />
  (<a href='https://codepen.io/aykanburcak'>@aykanburcak</a>) on <a href='https://codepen.io'>CodePen</a>.<br />
</iframe><br />
As you can see in the console, I&#8217;ve added <strong>&#8220;isActive&#8221;</strong> property to all objects and only for the first object I&#8217;ve this <strong>true </strong>to make the first tab active as default.</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-add-new-property-in-array-of-objects-using-javascript/">How to add new property in array of objects using JavaScript</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to change input placeholder color with CSS</title>
		<link>https://www.aykanburcak.com/en/yazilar/how-to-change-input-placeholder-color-with-css/</link>
		
		<dc:creator><![CDATA[aykanburcak]]></dc:creator>
		<pubDate>Wed, 10 Feb 2021 20:02:49 +0000</pubDate>
				<category><![CDATA[Frontend Development]]></category>
		<guid isPermaLink="false">http://www.aykanburcak.com/?post_type=lastposts&#038;p=1200</guid>

					<description><![CDATA[<p>Using the code block below, you can change the placeholder colors of all inputs...</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-change-input-placeholder-color-with-css/">How to change input placeholder color with CSS</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></description>
										<content:encoded><![CDATA[<p>Using the code block below, you can change the placeholder colors of all inputs on your website.</p>
<pre><code class="css">
input::-moz-placeholder {
  color: #1d1c22;
  opacity: 1;
}
input:-ms-input-placeholder {
  color: #1d1c22;
}
input::-webkit-input-placeholder {
  color: #1d1c22;
}</code></pre>
<p>Of course you can define and target specific classes like this:</p>
<pre><code class="css">.form-control::-moz-placeholder {
  color: #1d1c22;
  opacity: 1;
}
.form-control:-ms-input-placeholder {
  color: #1d1c22;
}
.form-control::-webkit-input-placeholder {
  color: #1d1c22;
}</code></pre>
<p>&nbsp;</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/how-to-change-input-placeholder-color-with-css/">How to change input placeholder color with CSS</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Getting the first paragraph of post on WordPress</title>
		<link>https://www.aykanburcak.com/en/yazilar/getting-the-first-paragraph-of-post-on-wordpress/</link>
		
		<dc:creator><![CDATA[aykanburcak]]></dc:creator>
		<pubDate>Wed, 10 Feb 2021 14:54:12 +0000</pubDate>
				<category><![CDATA[Wordpress Theme Development]]></category>
		<guid isPermaLink="false">http://www.aykanburcak.com/?post_type=lastposts&#038;p=1186</guid>

					<description><![CDATA[<p>Getting the first paragraph is a handy function for WordPress because we can use this on almost every page of a website.</p>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/getting-the-first-paragraph-of-post-on-wordpress/">Getting the first paragraph of post on WordPress</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></description>
										<content:encoded><![CDATA[<p>Getting the first paragraph is a handy function for WordPress because we can use this on almost every page of a website.<br />
You can use this function to get the first paragraph:</p>
<pre>
<code class="php">
function get_first_paragraph(){
	global $post;
	
	$str = wpautop( get_the_content() );
	$str = substr( $str, 0, strpos( $str, '&lt;/p&gt;' ) + 4 );
	$str = strip_tags($str, '&lt;a&gt;&lt;strong&gt;&lt;em&gt;');
	return '&lt;p&gt;' . $str . '&lt;/p&gt;';
}
</code>
</pre>
<p><a rel="nofollow" href="https://www.aykanburcak.com/en/yazilar/getting-the-first-paragraph-of-post-on-wordpress/">Getting the first paragraph of post on WordPress</a> yazısı ilk önce <a rel="nofollow" href="https://www.aykanburcak.com/en">Aykan Burçak</a> üzerinde ortaya çıktı.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
