<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Khadija Batool Gardezi</title>
    <description>The latest articles on Forem by Khadija Batool Gardezi (@khadijagardezi).</description>
    <link>https://forem.com/khadijagardezi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F379513%2Ff5063aae-0bd8-4e88-850a-6b989de6b915.jpeg</url>
      <title>Forem: Khadija Batool Gardezi</title>
      <link>https://forem.com/khadijagardezi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/khadijagardezi"/>
    <language>en</language>
    <item>
      <title>Developer Code vs Browser Code</title>
      <dc:creator>Khadija Batool Gardezi</dc:creator>
      <pubDate>Tue, 26 Nov 2024 15:27:27 +0000</pubDate>
      <link>https://forem.com/khadijagardezi/developer-code-vs-browser-code-52l7</link>
      <guid>https://forem.com/khadijagardezi/developer-code-vs-browser-code-52l7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2qraglx2u4aq7fs5xqry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2qraglx2u4aq7fs5xqry.png" alt="Image" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>Callback function in js?🧐</title>
      <dc:creator>Khadija Batool Gardezi</dc:creator>
      <pubDate>Sat, 16 Nov 2024 11:35:20 +0000</pubDate>
      <link>https://forem.com/khadijagardezi/callback-function-in-js-4m35</link>
      <guid>https://forem.com/khadijagardezi/callback-function-in-js-4m35</guid>
      <description>&lt;p&gt;So basically, a callback function is a function() passed as an argument to another function. It is executed for each element in the array during iteration.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;code&gt;recipe =&amp;gt; recipe.name.toLowerCase().includes(filter.toLowerCase())&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Method: &lt;code&gt;.filter()&lt;/code&gt;&lt;br&gt;
Loops through each item in the recipes array and runs the callback function to decide if that item should be included in the filtered results.&lt;/p&gt;

&lt;p&gt;Callback Function:&lt;br&gt;
&lt;code&gt;recipe =&amp;gt; recipe.name.toLowerCase().includes(filter.toLowerCase())&lt;/code&gt;&lt;br&gt;
Parameters:&lt;br&gt;
recipe: Represents the current element in the recipe array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;recipe.name.toLowerCase():&lt;/code&gt; Converts the recipe's name to lowercase for case-insensitive comparison.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.includes(filter.toLowerCase()):&lt;/code&gt; Checks if the lowercase filter string is part of the recipe's name.&lt;/p&gt;

&lt;p&gt;The arrow function &lt;code&gt;(recipe =&amp;gt; recipe.name...)&lt;/code&gt; is the callback here.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Functions as User Interface</title>
      <dc:creator>Khadija Batool Gardezi</dc:creator>
      <pubDate>Sun, 30 Jun 2024 16:46:25 +0000</pubDate>
      <link>https://forem.com/khadijagardezi/functions-as-user-interface-35c8</link>
      <guid>https://forem.com/khadijagardezi/functions-as-user-interface-35c8</guid>
      <description>&lt;p&gt;Hi, y'all. ✨&lt;/p&gt;

&lt;p&gt;My journey in the tech world has been filled with countless lines of code, numerous tools, and multiple languages. I have experience with JavaScript, ReactJS, CraftCMS, Twig, and a few more. As a woman in tech, I understand the challenges of this field. I am dedicated to sharing my knowledge and experiences to help others like me grow and thrive. Let's get started and become experts together!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions as UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React, functions can be used to define UI components. This allows you to create reusable and modular pieces of your user interface. To illustrate this concept, let's build a simple React component that displays the text "Hello, Khadija."&lt;/p&gt;

&lt;p&gt;In standard HTML, we write something like below to display a message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello JavaScript&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works fine for static content. right? isn't it? But what if we want to change the message dynamically based on user interaction or some other logic? That’s where React and JavaScript functions come into play.&lt;/p&gt;

&lt;p&gt;First, we will create a function component named App. This component will use another function, getLanguage, to get the text "Khadija" and display it within an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// Without return, the function would return undefined.&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Khadija&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello, &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;getName&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code snippet, we defined a simple React component called App that uses a function Message to return the string "Khadija". This string is then displayed inside an h1 tag in our component.&lt;/p&gt;

&lt;p&gt;By using functions in this way, we can make our UI more dynamic and responsive to changes in data or state. It allows us to create interactive and responsive applications with ease. This example demonstrates how we can use a simple function to dynamically update the content of our components.&lt;/p&gt;

&lt;p&gt;Thank you for following along &amp;amp; Happy coding! 💻&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The next part is coming soon&lt;/em&gt;.📝&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Let's interact with Ruby.</title>
      <dc:creator>Khadija Batool Gardezi</dc:creator>
      <pubDate>Thu, 26 Oct 2023 22:03:06 +0000</pubDate>
      <link>https://forem.com/khadijagardezi/lets-interact-with-ruby-em5</link>
      <guid>https://forem.com/khadijagardezi/lets-interact-with-ruby-em5</guid>
      <description>&lt;p&gt;Hey there, it's Khadija from Pakistan. I am a Web Developer.&lt;/p&gt;

&lt;p&gt;Recently, I have developed a keen interest in delving deeply into Ruby, and I'm planning to share all my learning experiences with you all. If you are a learning or experienced developer, let's connect and share ideas!&lt;/p&gt;

&lt;p&gt;Do you know? Ruby is a versatile and powerful programming language that has garnered a lot of attention since its creation in the mid-1990s. Ruby's syntax is designed to be clean, consistent, and readable. This makes the code not only easier to write but also easier to maintain and understand.&lt;/p&gt;

&lt;p&gt;I started with the installation process, which was not easy, even though the language itself is very simple.&lt;/p&gt;

&lt;p&gt;I am currently utilizing various resources to enhance my knowledge. These include Codecademy, Pragmatic Studio, and YouTube.&lt;/p&gt;

&lt;p&gt;Here's the Ruby resource link if anyone is interested:&lt;br&gt;
&lt;a href="https://www.codecademy.com/courses/learn-ruby"&gt;Codecademy&lt;/a&gt; &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>webdev</category>
      <category>womenintech</category>
    </item>
  </channel>
</rss>
