<?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>DEV Community: E.Tulasi Ram</title>
    <description>The latest articles on DEV Community by E.Tulasi Ram (@aizon).</description>
    <link>https://dev.to/aizon</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%2F1920964%2Feccc818a-8aae-44f7-843b-0bcfd8035c2d.png</url>
      <title>DEV Community: E.Tulasi Ram</title>
      <link>https://dev.to/aizon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aizon"/>
    <language>en</language>
    <item>
      <title>React SetUps and File Structure</title>
      <dc:creator>E.Tulasi Ram</dc:creator>
      <pubDate>Tue, 03 Sep 2024 16:20:59 +0000</pubDate>
      <link>https://dev.to/aizon/react-setups-and-file-structure-42gf</link>
      <guid>https://dev.to/aizon/react-setups-and-file-structure-42gf</guid>
      <description>&lt;h2&gt;
  
  
  1. Install Node.js and npm
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt; is a JavaScript runtime that allows you to run JavaScript on the server side, and npm (Node Package Manager) is a tool for managing packages (libraries) for Node.js.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Download and install Node.js&lt;/strong&gt; from &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js official website. &lt;/a&gt;The installation includes npm, so you don't need to install npm separately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify installation:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands should print the versions of Node.js and npm if the installation was successful.&lt;br&gt;
&lt;strong&gt;2. Create a New React Project&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Using npx (recommended):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal (Command Prompt on Windows, Terminal on macOS/Linux).&lt;/li&gt;
&lt;li&gt;Run the following command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Replace &lt;strong&gt;my-react-app with your desired project name. This command uses npx to run create-react-app&lt;/strong&gt; without installing it globally.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Navigate to Your Project Directory
&lt;/h2&gt;

&lt;p&gt;Change to your project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd .\my-react-app\
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Start the Development Server
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Run the development server:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the development server and opens your application in the default web browser at &lt;strong&gt;&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/strong&gt; The server will automatically reload the page whenever you make changes to the source code.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Explore the Folder Structure
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Here’s a breakdown of the folder structure created by create-react-app:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-app/
├── node_modules/
├── public/
│   ├── index.html
│   └── manifest.json
├── src/
│   ├── components/
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   └── reportWebVitals.js
├── .gitignore
├── package-lock.json
├── package.json
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;public/&lt;/strong&gt;: Contains static files that are served directly by the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index.html:&lt;/strong&gt; The main HTML file where your React app is injected.&lt;br&gt;
 &lt;strong&gt;favicon.ico:&lt;/strong&gt;The icon displayed in the browser tab.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;src/:&lt;/strong&gt; Source code of the React app.&lt;br&gt;
 &lt;strong&gt;index.js:&lt;/strong&gt; Entry point that renders the root component.&lt;br&gt;
&lt;strong&gt;App.js:&lt;/strong&gt; Main React component to edit and display content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;node_modules/:&lt;/strong&gt; Installed npm packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;package.json:&lt;/strong&gt; Project metadata, dependencies, and scripts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;package-lock.json:&lt;/strong&gt; Locks dependency versions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;.gitignore:&lt;/strong&gt; Files and directories to be ignored by Git.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;README.md:&lt;/strong&gt; Documentation for your project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create a React Component
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;React components can be either class-based or function-based. Function components are more common, especially with the use of Hooks.
&lt;strong&gt;Here's an example of a simple function component:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Hello, React!&amp;lt;/h1&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This component returns some JSX, which looks like HTML but is actually JavaScript.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Call(),Apply(),Bind() Methods</title>
      <dc:creator>E.Tulasi Ram</dc:creator>
      <pubDate>Wed, 14 Aug 2024 11:33:32 +0000</pubDate>
      <link>https://dev.to/aizon/callapplybind-methods-3m9a</link>
      <guid>https://dev.to/aizon/callapplybind-methods-3m9a</guid>
      <description>&lt;h2&gt;
  
  
  Call() :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Call() method is used to invoke a function directly by passing the reference which is points to the 'this' variable inside method.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Apply():
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Apply() method is similar to call method but only  differeces is it takes the 2nd arguments has a array list of of the parameter which is passed to the function. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bind():
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bind() method does not directly invoke the method but gives to the copy of the exactly same method which can be invoke later.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Promises</title>
      <dc:creator>E.Tulasi Ram</dc:creator>
      <pubDate>Wed, 14 Aug 2024 10:46:46 +0000</pubDate>
      <link>https://dev.to/aizon/promises-49ed</link>
      <guid>https://dev.to/aizon/promises-49ed</guid>
      <description>&lt;h2&gt;
  
  
  Why Promises required?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Callbacks is a great way when we are dealing with basic cases like minimal asynchronous operations.But when we are developing a web application that has lots of code, then working with Callback will be messy. This excessive Callback nesting is often referred to as Callback hell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To deal with such case we use &lt;strong&gt;promises&lt;/strong&gt; instead of &lt;strong&gt;Callbacks&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does  promises work ?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Promises is an object which represents the eventual completion or failure of an asynchronus operation and return a single value &lt;br&gt;
based on the operation being rejected or resolved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has three states &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Pending &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.Fulfilled &lt;/p&gt;

&lt;p&gt;3.Rejected &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pending:&lt;/strong&gt;It is the initial state of each Promise. It represents that the result has not been computed yet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fulfilled:&lt;/strong&gt;It means that the operation has completed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rejected:&lt;/strong&gt;It represents a failure that occurs during computation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating a promise
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In JavaScript, we can create a Promise by using the &lt;strong&gt;Promise()&lt;/strong&gt; constructor. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const promise = new Promise((resolve,reject)=&amp;gt;{...});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let Promise = new Promise((resolve, reject)=&amp;gt;{  
    let a = 3;  
    if(a==3){  
        resolve('Success');  
    }  
    else{  
        reject('Failed');  
    }  
}); 
Promise.then((message)=&amp;gt;{  
    console.log(message)  
}).catch((message)=&amp;gt;{  
console.log(message)  
})  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt; &lt;br&gt;
&lt;code&gt;Success&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Promise methods
&lt;/h2&gt;

&lt;p&gt;The Promise methods are used to handle the rejection or resolution of the Promise object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.then()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This method invokes when a Promise is either fulfilled or rejected. This method can be chained for handling the rejection or fulfillment of the Promise. It takes two functional arguments for &lt;strong&gt;resolved&lt;/strong&gt; and &lt;strong&gt;rejected&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let success = (a) =&amp;gt; {  
    console.log(a + " it worked!")  
  }  

  let error = (a) =&amp;gt; {  
    console.log(a + " it failed!")  
  }  

  const Promise = num =&amp;gt; {  
    return new Promise((resolve,reject) =&amp;gt; {  
      if((num%2)==0){  
        resolve("Success!")  
      }  
      reject("Failure!")  
    })  
  }  

  Promise(100).then(success, error)   
  Promise(21).then(success,error)  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Success! it worked!&lt;br&gt;
Failure! it failed!&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.Catch()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a great way to handle failures and rejections. It takes only one functional argument for handling the errors. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Promise = num =&amp;gt; {  
    return new Promise((resolve,reject) =&amp;gt; {  
      if(num &amp;gt; 0){  
        resolve("Success!")  
      }  
      reject("Failure!")  
    })  
  }  

  Promise(20).then(res =&amp;gt; {  
    throw new Error();  
    console.log(res + " success!")  
  }).catch(error =&amp;gt; {  
    console.log(error + " oh no, it failed!")  
  })  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OutPut&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Error oh no, it failed!&lt;/code&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Array Methods</title>
      <dc:creator>E.Tulasi Ram</dc:creator>
      <pubDate>Tue, 13 Aug 2024 16:20:45 +0000</pubDate>
      <link>https://dev.to/aizon/array-methods-228o</link>
      <guid>https://dev.to/aizon/array-methods-228o</guid>
      <description>&lt;h2&gt;
  
  
  Map(),Filter(),Reduce()
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Absolutely! Understanding the array methods map(), filter(), and reduce() is essential for anyone learning JavaScript, especially for students who are diving into frameworks like React.js. These methods are not only powerful for data manipulation but also align well with functional programming principles, which are prevalent in modern JavaScript development. Let's explore each of these methods in detail. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Map()
&lt;/h2&gt;

&lt;p&gt;Description:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It's return the new array by applying function to each element in original array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The map() method in JavaScript does not manipulate the original array;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Filter()
&lt;/h2&gt;

&lt;p&gt;Description:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The filter() method creates a new array containing all elements that pass a test implemented by the provided function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The filter() method in JavaScript does not manipulate the original array;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reduce()
&lt;/h2&gt;

&lt;p&gt;Description:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The reduce() method processes the each element in an array and reduces into single value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The reduce method does not change the original array.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
