<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arief on Medium]]></title>
        <description><![CDATA[Stories by Arief on Medium]]></description>
        <link>https://medium.com/@ariefbadal21?source=rss-18cba746e829------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yhStwieHKkjtvFKd1bzKLA.png</url>
            <title>Stories by Arief on Medium</title>
            <link>https://medium.com/@ariefbadal21?source=rss-18cba746e829------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:42:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ariefbadal21/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[C# datatypes]]></title>
            <link>https://medium.com/@ariefbadal21/c-datatypes-356abcceef7b?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/356abcceef7b</guid>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 14:59:16 GMT</pubDate>
            <atom:updated>2023-11-13T14:59:16.137Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi readers,</p><p>Currently I’m in process learning C# and today I want to try to explain about a very important concept and one of the first steps while learning it.</p><p>So in C# you define a variable like so: &lt;type&gt; &lt;identifier&gt;. Because C# is a static typed language it’s always required to pass the type you want for your variable.</p><p>We have primitive and non-primitive datatypes in C#.</p><p><strong>Primitive types</strong> are <em>byte, short, long, int, float, double, decimal, char and bool</em>. There are a lot more but these are the most commonly used. These are stored inside the <strong>stack</strong>.</p><p>And the <strong>non-primitive types</strong> are:<em> enums, class, struct, arrays and strings</em>. In this case stored in the <strong>heap</strong>.</p><p>These two can also be divided in <em>reference types and value types</em>.</p><p>Structures are:</p><ul><li>primitive types</li><li>and custom types</li></ul><p>These are <strong><em>value types</em></strong> which are stored in the stack at runtime, the memory allocation is automatic and if the variable is out of scope (in a function for example it will immediatly be deleted)</p><p>Reference types at the other hand, you have to allocate the memory yourself, for example with arrays you have to do :</p><pre>new array[3]{1,2,3};</pre><p>instead of the stack all reference types are stored inside the heap.</p><p>And the heap has a garbage collector to clean up unused memory.</p><h3>Value vs reference types</h3><p>With value types the value is stored directly in memory and you can ask for the data directly. With reference types on the other hand the value of those objects are stored in the heap instead of the stack. In the stack there will be a reference to the object (a pointer, which is the memory address to the object with the data), because of that the stack is a lot faster than the heap.</p><p>When you are trying to use a copy of a value type,the data will not be the same because the new object is pointing to a differently created object.</p><p>On the other hand a copy of a reference type will be pointing to the same object with the same memory address .</p><p>So its always a good idea to think about the datastrucuture you want to use before hand to get the most out of the performance of your application.</p><p>To show you an example with some code:</p><pre>// Creates a copy of &#39;age&#39;<br>  var anotherage= age;<br>  // changes the value of the copied version<br>  anotherage=21;<br>  Console.WriteLine(anotherage);<br>  Console.WriteLine(age);<br>  <br>  // array with names<br>  string[] names = {&quot;mary&quot;, &quot;suzan&quot;, &quot;Gio&quot;};<br>  // makes a copy<br>  string[] copynames = names;<br>  // changes of element of the first element<br>  copynames[0]=&quot;Arief&quot;;<br>  // the first value is changed<br>  Console.WriteLine(copynames[0]);<br>  // because the copied version &#39;copynames&#39; is pointing to the same object in the heap its also changing the original one<br>  Console.WriteLine(names[0]);</pre><p>I hope it is a clear explanation of this concept. If you have any feedback for me please let me know.</p><p>~Arief</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=356abcceef7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn ReactJS with me | useEffect Hook]]></title>
            <link>https://medium.com/@ariefbadal21/learn-reactjs-with-me-useeffect-hook-c96643c9d176?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/c96643c9d176</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Sat, 26 Nov 2022 19:49:47 GMT</pubDate>
            <atom:updated>2022-11-26T19:49:47.275Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NvYH0DRNhXLTIhCl" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hi, today I will continue explain more about some of the ReactJS concepts which I have learned on my way to understand and learn the React framework.</p><p>Today I will discuss about the useEffect hook, which is very important to learn.</p><p>With the useEffect hook you tell React to do something after the component is rendered. You have to pass 2 arguments:</p><ol><li>The first one is the function which will execute, the so called “effect”</li><li>The dependancy array</li></ol><p>The dependancy array is an Javascript array. If you pass this array React will only execute the function if one of the values have changed.</p><p>If the array is empty, the function will only execute when the component is rendered for the first time.</p><p>Here I have a small code example:</p><pre>import React, { useState, useEffect } from &quot;react&quot;;<br><br>function Example() {<br>  const [count, setCount] = useState(0);<br><br><br>// Similar to componentDidmount and componentDidupdate:<br>/* By using this Hook, you tell React that your component needs to do something after render.<br>   React will remember the function you passed (we’ll refer to it as our “effect”),<br>    and call it later after performing the DOM updates.n this effect, we set the document title,<br>     but we could also perform data fetching or call some other imperative API.<br>*/<br>  useEffect(() =&gt; {<br>    // update the document title using the browser API<br>    document.title = `you clicked ${count} times`;<br>  });<br><br>  return (<br>    &lt;&gt;<br>      &lt;p&gt;You clicked {count} times&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Click me&lt;/button&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>export default Example;</pre><p>You can also find this example on the official React docs:</p><p><a href="https://reactjs.org/docs/hooks-effect.html">Using the Effect Hook - React</a></p><p>Sometimes you will see something called a clean up function</p><p>There are 2 kinds of components one which needs a cleanup function and one without.</p><p>The one without are mostly things like:</p><ul><li>Network requests</li><li>Manual DOM mutations</li><li>Logging</li></ul><p>This is because we run this kind of tasks once and forget about them.</p><p>The components which need a cleanup function are tasks with a subscription to a third-party data source.</p><p>If you choose not to use a cleanup function your program would be vulnerable for a memory leak.</p><p>The useEffect hook is one of the many hooks React offer.</p><p>I hope this was informative, if you have any feedback on my article let me know.</p><p>~Arief</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c96643c9d176" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threads (multi-threading processing)]]></title>
            <link>https://medium.com/@ariefbadal21/threads-multi-threading-processing-f1b93ca76db8?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1b93ca76db8</guid>
            <category><![CDATA[cpu]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[threads]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 21:18:51 GMT</pubDate>
            <atom:updated>2022-10-30T21:18:51.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pYoXoeosGxkfy6pX" /><figcaption>Photo by <a href="https://unsplash.com/@jsshotz?utm_source=medium&amp;utm_medium=referral">Jorge Salvador</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Currently I’m working on a Python project where we make use of the multi-threading processing, but are threads?</p><p>In this article I will try to explain in my own words what it is and what it does.</p><p>A thread is a virtual version of a physical CPU core.</p><p>For Intel CPU’s it&#39;s called hyper threading and for AMD it&#39;s called simultaneous threading, splitting a core in to virtual cores.</p><p>So, what are the purpose of threads?</p><p>Threads gives the CPU the ability to work on different tasks simultaneously and it makes the task its working on faster. A computer can multitask because of the threads it uses.</p><p>1 core gives 2 threads. These days most of the computers uses 4 cores.</p><p>A core is a processing unit inside the CPU (Central Processing Unit) the brain of the computer.</p><p>Dual core — 2 cores — 2x2 = 4 threads</p><p>Quad core — 4 cores — 4x2 = 8 threads</p><p>Octa core — 8 cores — 8x2 = 16 threads</p><p>Threads allows the processor to perform multiple tasks at the same time, make the task faster and also making the computer capable of multitasking.</p><p>This is just a short explanation of what I had learned, I hope it was understandable and informative</p><p>Thank you for reading my article.</p><p>~Arief</p><p>references:</p><ul><li><a href="https://www.geeksforgeeks.org/what-are-threads-in-computer-processor-or-cpu/#:~:text=Threads%20are%20the%20virtual%20components,it%20will%20have%204%20threads.">What are Threads in Computer Processor or CPU? — GeeksforGeeks</a></li><li><a href="https://www.tomshardware.com/news/cpu-core-definition,37658.html">What Is a CPU Core? A Basic Definition | Tom’s Hardware (tomshardware.com)</a></li><li><a href="https://www.hp.com/us-en/shop/tech-takes/hyper-threading-everything-to-know">Hyper-Threading and Everything You Need to Know (hp.com)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1b93ca76db8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn ReactJS with me | React Props]]></title>
            <link>https://medium.com/@ariefbadal21/learn-reactjs-with-me-react-props-186f5bfb3d38?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/186f5bfb3d38</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 20:30:27 GMT</pubDate>
            <atom:updated>2022-09-16T20:30:27.919Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today I’m going to write about React <strong>props.</strong></p><p>What are props? Props stand for properties which you can use to pass information to other components.</p><p>Key points to note:</p><ul><li>Props are immutable (which means they can&#39;t be changed)</li><li>The information will be shared down the component hierarchy, so from the <strong>Parent component </strong>to the <strong>Child component </strong>and cannot be send back upwards to the Parent component.</li><li><strong>Props </strong>is actually a JavaScript object. You can check this with console.log()</li><li>React props are like JavaScript function arguments and attributes in HTML. To send props into a component, use the same syntax as HTML</li></ul><p>Say we want to create a webshop with different products.</p><p>In App.js</p><p>We write:</p><blockquote>function App() {</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote># Here we created multiple Product instances</blockquote><blockquote><strong>&lt;<em>Product</em></strong></blockquote><p><em># You pass the props arguments as HTML attributes</em></p><blockquote><em>name</em>=”iPhone 14 Pro Max”</blockquote><blockquote><em>description</em>=”The newest greates iPhone”</blockquote><blockquote><em>price</em>={1200}</blockquote><blockquote><strong>/&gt;</strong></blockquote><blockquote>&lt;<em>Product</em></blockquote><blockquote><em>name</em>=”Samsung Galaxy 22&quot;</blockquote><blockquote><em>description</em>=”Powerfull Samsung smarthone”</blockquote><blockquote><em>price</em>={900}</blockquote><blockquote>/&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>}</blockquote><blockquote>export default App;</blockquote><blockquote># A <strong><em>Product </em></strong>Function component</blockquote><blockquote>function <strong>Product</strong>(props) {# Here we pass props as the arguments.</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote># Here we want to output the props name, description and price</blockquote><blockquote>&lt;h1&gt;{<em>props</em>.name}&lt;/h1&gt;</blockquote><blockquote>&lt;p&gt;{<em>props</em>.description}&lt;/p&gt;</blockquote><blockquote>&lt;h3&gt;${<em>props</em>.price}&lt;/h3&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>}</blockquote><blockquote>export default Product;</blockquote><p>If you run this and open this in your browser, you will get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*vCG1sM3Ip5i80fldg8hVqA.png" /></figure><p>Now we want to create a seperate product description component, so we have to change our code a little bit:</p><p>Creat a itemDescription.js</p><p>with the following code:</p><blockquote>function ItemDescription({<em>name</em>, <em>description</em>}) {</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote>&lt;p&gt;{<em>name</em>}&lt;/p&gt;</blockquote><blockquote>&lt;p&gt;</blockquote><blockquote>&lt;i&gt;{<em>description</em>}&lt;/i&gt;</blockquote><blockquote>&lt;/p&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>}</blockquote><blockquote>export default ItemDescription;</blockquote><p>in Product.js</p><blockquote>// object destructering instead of using props.name etc.</blockquote><blockquote>function Product({ <em>name</em>, <em>description</em>, <em>price</em> }) {</blockquote><blockquote>/* Here we are passing the name, description and price which are passed to</blockquote><blockquote>the Product component to the ItemDescription component */</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote>&lt;<em>ItemDescription</em> <em>name</em>={<em>name</em>} <em>description</em>={<em>description</em>} /&gt;</blockquote><blockquote>&lt;h3&gt;${<em>price</em>}&lt;/h3&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>}</blockquote><blockquote>export default Product;</blockquote><p>I hope this helped you understand React props better. If you have any feedback let me know.</p><p>Thank you for reading my article :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=186f5bfb3d38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn ReactJS with me | useState hook]]></title>
            <link>https://medium.com/@ariefbadal21/learn-reactjs-with-me-usestate-hook-18d5fa38e109?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/18d5fa38e109</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Thu, 08 Sep 2022 16:44:36 GMT</pubDate>
            <atom:updated>2022-10-20T18:59:33.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eCRs5HuutLL0W57c" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank?utm_source=medium&amp;utm_medium=referral">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hi, today I’m going to write about the useState hook from React.</p><p>In React it is not allowed to mutate React props (this wil be discussed in another article) because they are only there to <strong><em>pass information from parent to child components.</em></strong></p><p>React state has a mutable data structure also known as <strong><em>stateful values.</em></strong></p><p><em>state </em>is essentially a built-in React object that is used to contain data or information about the component. Whenever a components state changes the component will re-render.</p><p>These known stateful values will be instantiated in a React component as so-called <strong><em>state,</em></strong> which can also be passed with props to child components. It can also be mutated by using a function to modify the state.</p><p>When the state gets mutated the component with the state and all child components will re-render.</p><p>Props and state are different concepts props are used to pass information from parent to the component hierarchy and state is used to change the information over time.</p><p>For example:</p><p>let&#39;s say we have a Search component with an input field, and we want to show the input on the page:</p><blockquote>const Search = () =&gt; {</blockquote><blockquote>// searchTerm = current state and setSearchTerm = function to update this state (state updater function)</blockquote><blockquote><strong>1.) const [searchTerm, setSearchTerm] = <em>React</em>.useState(‘ ‘);</strong></blockquote><blockquote>const handleChange = (<em>event</em>) =&gt; {</blockquote><blockquote><strong>2.) </strong>setSearchTerm(<em>event</em>.target.value)</blockquote><blockquote>};</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote>&lt;label <em>htmlFor</em>=”search”&gt;Search: &lt;/label&gt;</blockquote><blockquote><strong>3.)</strong> &lt;input <em>id</em>=”search” <em>type</em>=”text” <em>onChange</em>={handleChange} /&gt;</blockquote><blockquote><strong>4.)</strong> &lt;p&gt;{searchTerm}&lt;/p&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>};</blockquote><p>First, we import the useState hook.</p><ol><li>The useState method wil return an array with two entries the (current) state (searchTerm) and a function to update the state <em>(state updater function)</em> (setSeachTerm), we also define an initial value, in this case an empty string.</li></ol><p>2. Defines the function that updates the state.</p><p>3. The input field where we pass the eventhandler</p><p>4. Here we call searchTerm which will show the current state on the page in this case the user input.</p><p>Thank you for reading my article. If you have any feedback let me know.</p><p>~Arief</p><p>Reference: The Road to React book by Robin Wieruch</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18d5fa38e109" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn ReactJS with me | Object destructuring]]></title>
            <link>https://medium.com/@ariefbadal21/learn-reactjs-with-me-object-destructuring-206475f1def2?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/206475f1def2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Sun, 04 Sep 2022 17:33:10 GMT</pubDate>
            <atom:updated>2022-09-04T17:33:10.940Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today I’am going to write about object destructuring.</p><h3>What is it?</h3><p>Destructuring is the act of unpacking elements of an array or object.</p><p>Its more elegant and is just one line of code.</p><p>For example:</p><p>Suppose we have an object</p><blockquote>let Gerda = {</blockquote><blockquote>firstname: “Gerda”,</blockquote><blockquote>lastname: “Doe”,</blockquote><blockquote>age: 21,</blockquote><blockquote>hobbies: {</blockquote><blockquote>hobby1: “Surfing”,</blockquote><blockquote>hobby2: “Dancing” }}</blockquote><p>let {firstname, lastname, age, hobbies:{hobby2}} = Gerda</p><p>In this case firstname, lastname, age and hobby2 reference to the key of the object. Its unpacking its value.</p><p>So if you console.log(firstname, lastname, hobby2)</p><p>The output will be:</p><blockquote>Gerda 21 Dancing</blockquote><p>It would also be possible to use a function to do this.</p><p>References:</p><p><a href="https://www.freecodecamp.org/news/top-javascript-concepts-to-know-before-learning-react/">Top JavaScript Concepts to Know Before Learning React (freecodecamp.org)</a></p><p>Thank you for reading my article.</p><p>~Arief</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=206475f1def2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn ReactJS with me | Array.find()]]></title>
            <link>https://medium.com/@ariefbadal21/learn-reactjs-with-me-array-find-dbbdeafe4633?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbbdeafe4633</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[beginner-javascript]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Sun, 21 Aug 2022 19:44:57 GMT</pubDate>
            <atom:updated>2022-08-21T19:44:57.966Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, today I’m going to write about the array.find() method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z_hfyjEY_-SV1KCM" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What does it do?</h3><p>The <strong>find()</strong> method returns the value of the first element that passes a test.</p><p>It executes the function for each array element. If there are no elements found it will return “undefined” in the output.</p><p>Besides that it will not execute the function for empty elements and it does not change the orginal array.</p><p>For example here we have an array with some objects</p><blockquote>let users = [</blockquote><blockquote>{ firstName: “Susan”, age: 14 },</blockquote><blockquote>{ firstName: “Daniel”, age: 16 },</blockquote><blockquote>{ firstName: “Bruno”, age: 56 },</blockquote><blockquote>{ firstName: “Jacob”, age: 15 },</blockquote><blockquote>{ firstName: “Sam”, age: 64 },</blockquote><blockquote>{ firstName: “Dave”, age: 56 },</blockquote><blockquote>{ firstName: “Neils”, age: 65 }</blockquote><blockquote>];</blockquote><p>We only want the person with the name Bruno and so we pass person as the current value to the anonymous function.</p><p>The find() method takes 3 parameters which are currentValue, index, array and thisValue. The last three are optional.</p><blockquote>const Bruno = users.find((person) =&gt; person.firstName === “Bruno”)</blockquote><blockquote>console.log(Bruno)</blockquote><p>The output will be:</p><blockquote>{ firstName: ‘Bruno’, age: 56 }</blockquote><p>This was just one example of what it does and how it works.</p><p>Thanks for reading. If you have any tips let me know!</p><p>Reference:</p><p><a href="https://www.w3schools.com/jsref/jsref_find.asp">JavaScript Array find() Method (w3schools.com)</a></p><p><a href="https://www.freecodecamp.org/news/top-javascript-concepts-to-know-before-learning-react/">Top JavaScript Concepts to Know Before Learning React (freecodecamp.org)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbbdeafe4633" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn React with me | Filter() array method]]></title>
            <link>https://medium.com/@ariefbadal21/learn-react-with-me-filter-array-method-1d506b33a944?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d506b33a944</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Wed, 17 Aug 2022 18:28:30 GMT</pubDate>
            <atom:updated>2022-08-17T18:28:30.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VOBeQ6pILxBvB2IE" /><figcaption>Photo by <a href="https://unsplash.com/@sapegin?utm_source=medium&amp;utm_medium=referral">Artem Sapegin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today I’m going to talk about the Filter() array method from Javascrpt.</p><p>The filter() method creates a new array filled with elements that pass a test provided by a function.</p><p>Other things to consider:</p><ul><li>Does not execute the function for empty elements</li><li>Does not change the orginal array</li></ul><p>For example:</p><blockquote>let users = [</blockquote><blockquote>{ firstName: “Susan”, age: 14 },</blockquote><blockquote>{ firstName: “Daniel”, age: 16 },</blockquote><blockquote>{ firstName: “Bruno”, age: 56 },</blockquote><blockquote>{ firstName: “Jacob”, age: 15 },</blockquote><blockquote>{ firstName: “Sam”, age: 64 },</blockquote><blockquote>{ firstName: “Dave”, age: 56 },</blockquote><blockquote>{ firstName: “Neils”, age: 65 }</blockquote><blockquote>];</blockquote><p>You want a new array with only young people, which are younger or equal to 15.</p><blockquote>const YoungPeople = users.filter((person) =&gt; {</blockquote><blockquote>return person.age &lt;= 15;</blockquote><blockquote>}</blockquote><p>console.log(YoungPeople)</p><p>#Output:</p><p><em>In the output you can see that there are two elements which are younger or equal than 15 years.</em></p><blockquote>[ { firstName: ‘Susan’, age: 14 }, { firstName: ‘Jacob’, age: 15 } ]</blockquote><p>Source:</p><p><a href="https://www.freecodecamp.org/news/top-javascript-concepts-to-know-before-learning-react/">Top JavaScript Concepts to Know Before Learning React (freecodecamp.org)</a></p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d506b33a944" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn React JS with me | Callback function Part 1]]></title>
            <link>https://medium.com/@ariefbadal21/learn-react-js-with-me-callback-function-part-1-1dc04d2caf1d?source=rss-18cba746e829------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dc04d2caf1d</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Arief]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 20:53:42 GMT</pubDate>
            <atom:updated>2022-08-15T20:54:43.257Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, my name is Arief and I’m a software developer student from the Netherlands and today I’m publishing my first article here on Medium.</p><p>I’am currently learning ReactJS and I’m going to share some knowledge about the concepts you need to know when learning React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0f0dJCEfL0wGbt5R" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>What is a callback function?</strong></h3><p>A callback function is function that will execute when another function finished executing.</p><p>For example:</p><blockquote>var numbers = [1, 2, 3, 4, 5];</blockquote><blockquote>const newArray = numbers.map(MyFunction)</blockquote><blockquote>#The callback function</blockquote><blockquote>function MyFunction (num){</blockquote><blockquote>const answer = num * 10</blockquote><blockquote>console.log(answer)</blockquote><blockquote>}</blockquote><p>So in this example we first created a variable with some numbers in it. After that we are using the map() array method to itterate over the array and execute the callback function (<strong>MyFunction</strong>) on each iterable in this case multiplying it by 10. To show the answer we use console.log()</p><p>Like I said the Myfunction will execute after the map() method has finished.</p><p>This was all about callback functions. Next I’am going to talk about the map(), filter() and find() array method.</p><p>If you have some feedback feel free to let me know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dc04d2caf1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>