<?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: certifieddev0101</title>
    <description>The latest articles on DEV Community by certifieddev0101 (@certifieddev19960101).</description>
    <link>https://dev.to/certifieddev19960101</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%2F1117687%2F2fe23893-edd1-41ca-8e77-b5a68862e2cd.jpg</url>
      <title>DEV Community: certifieddev0101</title>
      <link>https://dev.to/certifieddev19960101</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/certifieddev19960101"/>
    <language>en</language>
    <item>
      <title>Top 9 Frontend Framework</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Fri, 18 Aug 2023 14:54:05 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/top-9-frontend-framework-dll</link>
      <guid>https://dev.to/certifieddev19960101/top-9-frontend-framework-dll</guid>
      <description>&lt;p&gt;The building blocks of early software development are frontend frameworks. However, there are a lot of alternatives available when it comes to creating visually stunning apps with excellent user experiences. We have put up a list of the top frontend frameworks for you as a service. Let’s investigate them!&lt;/p&gt;

&lt;p&gt;Every company in the market today places the highest focus on the user experience. Even the project brief you receive as a developer mentions how straightforward the user interface should be. No matter how complicated the backend processes and procedures are, what people see and feel must be seamless. Some of the most prosperous businesses, like Netflix, Facebook, Instagram, etc., operate under this philosophy.&lt;/p&gt;

&lt;p&gt;Any of these websites will wow you with their strength, simplicity, and excellent user interface. All due to the several frameworks that are active in the background. However, there is a continuing need to improve usability and functionality due to the market’s and consumers’ rising expectations. At that point, worries start to surface.&lt;/p&gt;

&lt;p&gt;I’ve encountered several consumers who are perplexed about which of the top front-end javascript frameworks would most effectively address their issues. Connect with Simform’s professionals to discuss and pick our frontend development services that meet your needs if you’re in the same predicament and want to find the finest web UI framework swiftly.&lt;/p&gt;

&lt;p&gt;Here, we discuss a few of the top front-end frameworks for 2022. Here is our suggestion for those of you wondering what some of the well-known front end frameworks are.&lt;/p&gt;

&lt;p&gt;The State of Best Frontend Frameworks&lt;br&gt;
The graph below, which compares the use popularity of each framework identified as one of the top front-end frameworks for 2021, illustrates the relative popularity of each framework. We can observe that Angular and React have been in high demand since the years 2015–2016.&lt;/p&gt;

&lt;p&gt;JQuery is something that has always been in demand. Because jQuery still works fantastically when you don’t need to employ large frameworks like Angular and Ember but require speedier development with little functionality, this is the reason.&lt;/p&gt;

&lt;p&gt;In the part that follows, let’s examine how each framework defines itself in its current form and how we should choose one over the other for our future development needs.&lt;/p&gt;

&lt;p&gt;Top Frontend Frameworks&lt;br&gt;
React, Angular, and Vue are the most well-liked frontend frameworks among developers, according to The State of JavaScript 2019, making them the top three frontend frameworks of 2022 as well.&lt;/p&gt;

&lt;p&gt;Let’s go into more depth about each of these. Emberjs and Svelte, however, have a unique situation. Svelte is a well-known framework that is still among the most recent frameworks, but developer communities have begun to take an interest in it. Emberjs is more powerful, but perhaps because of its traditional learning curve approach, not many developers have utilised it.&lt;/p&gt;

&lt;h1&gt;
  
  
  1 React
&lt;/h1&gt;

&lt;p&gt;React, one of the most straightforward frameworks to learn, was created at Facebook to address problems with code maintainability brought on by the ongoing addition of functionality to the app. React is currently an open-source framework that stands out for the remarkable capabilities it provides thanks to its virtual Document Object Model (DOM). An excellent framework for people who need a reliable platform to manage large traffic and expect it.&lt;/p&gt;

&lt;p&gt;As a technical consultant, I would suggest React for projects involving the development of PWAs and single-page web apps.&lt;/p&gt;

&lt;p&gt;When to use React:&lt;/p&gt;

&lt;p&gt;When creating user interfaces, React is particularly useful, especially when creating single-page apps. Since you can reuse the components, it is the most reliable frontend framework when you want to construct an interactive interface quickly.&lt;/p&gt;

&lt;p&gt;When not to use React:&lt;/p&gt;

&lt;p&gt;React isn’t the best choice if you don’t have any practical expertise with Javascript. Furthermore, the JSX learning curve is a little challenging for less experienced coders.&lt;/p&gt;

&lt;h1&gt;
  
  
  2 Angular
&lt;/h1&gt;

&lt;p&gt;Without Angular, no list of the top front end development frameworks would be complete. The sole TypeScript-based framework on this list is Angular. Google created Angular, which was formally introduced in 2016, to fill the gap between the expanding needs of technology and tried-and-true ideas that produced results.&lt;/p&gt;

&lt;p&gt;Angular is distinct from React thanks to its two-way data binding functionality. It indicates that the model and the view are synchronised in real-time, meaning that any change made to the model is immediately reflected in the view and vice versa.&lt;/p&gt;

&lt;p&gt;Angular is ideal for your project whether it entails creating mobile or web apps! Additionally, you may utilise this framework to create progressive web apps and multi-page websites. Businesses like BMW, Xbox, Forbes, Blender, and others use Angular to deliver their apps.&lt;/p&gt;

&lt;p&gt;Angular is more difficult to understand than React. Despite the abundance of documentation, it is difficult to read it since it is either too complicated or incomprehensible.&lt;/p&gt;

&lt;p&gt;When to use Angular&lt;/p&gt;

&lt;p&gt;Due to the usage of two-way data binding, Angular improves the efficiency of browser-based apps by quickly updating the contents. Using Angular is the ideal option for enterprise-based applications and dynamic web apps.&lt;/p&gt;

&lt;p&gt;When to avoid using Angular&lt;/p&gt;

&lt;p&gt;An all-inclusive frontend framework is Angular. You cannot utilise the resources that Angular offers if you wish to create apps with constrained scopes. Additionally, use a more compact framework with less complicated syntax when your team is smaller.&lt;/p&gt;

&lt;h1&gt;
  
  
  3 Vuejs
&lt;/h1&gt;

&lt;p&gt;Vue is a clear and easy-to-use front-end framework that is now one of the most popular. It works well at simplifying the challenges that Angular developers encounter. It is less in size and offers two significant advantages — visible DOM and component-based. It has a two-way binding as well.&lt;/p&gt;

&lt;p&gt;Vue is flexible and supports you in a variety of endeavours. It can easily manage both straightforward and dynamic operations, including developing online applications, mobile applications, and progressive web applications.&lt;/p&gt;

&lt;p&gt;Despite being designed to address complexity and increase app speed, it is not particularly well-liked by industry titans. However, this framework is used by Xiaomi, Alibaba, 9gag, Reuters, and others. Despite less interest from Silicon Valley, Vue continues to gain momentum.&lt;/p&gt;

&lt;p&gt;When to use:&lt;/p&gt;

&lt;p&gt;Vuejs is advised for design structures with flexibility. It enables you to create anything from scratch and works well when creating enormous projects.&lt;/p&gt;

&lt;p&gt;When to use:&lt;/p&gt;

&lt;p&gt;Vuejs is not the way to go if you believe the support community will be there to address the difficulties. Additionally, as the framework has demonstrated issues with component stability, Vuejs is not ideal for building applications that require reliable components.&lt;/p&gt;

&lt;h1&gt;
  
  
  4 jQuery
&lt;/h1&gt;

&lt;p&gt;One of the first frontend frameworks was jQuery, which was released in 2006. Its relevance even in the modern digital world, despite its debut date, is what makes it unique. In addition to providing simplicity and convenience of use, jQuery also reduces the need to write lengthy JavaScript scripts.&lt;/p&gt;

&lt;p&gt;There is a sizable jQuery community for the solutions because to its long existence.&lt;/p&gt;

&lt;p&gt;Fundamentally a library, jQuery enhances a website’s functionality and interaction by allowing for the manipulation of DOM and CSS.&lt;/p&gt;

&lt;p&gt;Although we couldn’t create mobile apps using jQuery, new advancements in jQuery Mobile have broadened the usage possibilities. Additionally, this framework has included support for building native mobile applications using its HTML5-based UI system, jQuery Mobile. Additionally, jQuery is compatible with whatever browser you want to use and is browser-friendly.&lt;/p&gt;

&lt;p&gt;when to use:&lt;/p&gt;

&lt;p&gt;The creation of desktop-based JavaScript apps uses jQuery. The framework maintains quite short and straightforward code. In order to handle events and carry out animations, it is utilised.&lt;/p&gt;

&lt;p&gt;When not to use:&lt;/p&gt;

&lt;p&gt;It is not practical to utilise jQuery while creating a large-scale programme since it adds a lot of unnecessary javascript code, which makes your application hefty. The framework cannot compete with more powerful javascript facilitation, less code, and component reuse in newer frameworks.&lt;/p&gt;

&lt;h1&gt;
  
  
  5 Emberjs
&lt;/h1&gt;

&lt;p&gt;Emberjs, which was created in 2011, is component-based and provides two-way data binding, much like Angular. It is made to easily meet the escalating demands of contemporary technology. With Emberjs, you can create intricate mobile and web apps while counting on its effective architecture to address issues.&lt;/p&gt;

&lt;p&gt;One of Ember’s minor drawbacks is its steep learning curve. Because of its tight and traditional nature, the framework ends up being one of the hardest frameworks to master. The developer community is modest because the field is still underdeveloped and young. Anyone who has no restrictions on making time for studying can pursue it.&lt;/p&gt;

&lt;p&gt;When to use:&lt;/p&gt;

&lt;p&gt;Emberjs is the framework with all the technical frontend assistance, such as viewing a broad range of application states due to the good routing offered by Emberjs, if you want to design contemporary apps with a sophisticated user experience like Linkedin.&lt;/p&gt;

&lt;p&gt;Because it offers a ready setup, practical binding, and custom properties to render the page as necessary, the framework stands as the comprehensive frontend solution for large-scale projects.&lt;/p&gt;

&lt;p&gt;When not to use:&lt;/p&gt;

&lt;p&gt;With a smaller development team, Emberjs isn’t the best option because the framework needs expertise and business logic to handle the complications. Emberjs could have a greater startup cost. Additionally, the framework might not be the best option for creating straightforward ajax operations and establishing a straightforward user interface.&lt;/p&gt;

&lt;h1&gt;
  
  
  6 Backbonejs
&lt;/h1&gt;

&lt;p&gt;Backbonejs, one of the simplest frameworks available, enables you to create single-page apps quickly. A framework based on the MVC architecture is used. The MVC architecture’s View enables the development of component logic similarly to a Controller.&lt;/p&gt;

&lt;p&gt;Additionally, this framework is capable of running engines like Moustache and underscore.js. To get the most out of the framework while creating Backbonejs-based apps, you may also leverage tools like Thorax, Marionette, Chaplin, Handlebars, and others.&lt;/p&gt;

&lt;p&gt;The platform also enables you to create projects that call for several user kinds, with the arrays serving as a means of model differentiation. Therefore, whether you plan to use Backbonejs for the frontend or the backend, this is a great option because of its compatibility with REST API, which enables easy synchronisation between the two.&lt;/p&gt;

&lt;p&gt;When to use:&lt;br&gt;
Dynamic apps like Trello employ Backbonejs. It enables programmers to create client-side models, create quicker updates, and reuse code. As a result, it effectively manages updates on the fly, keeps the client up to date, and keeps everything in sync with the server.&lt;/p&gt;

&lt;p&gt;When not to use:&lt;/p&gt;

&lt;p&gt;Compared to other MVC client-side frameworks, Backbonejs has a more straightforward need for developing a web application. However, with the assistance of plugins and extensions, you may increase the features. Therefore, instead of striving for backbonejs, the development team should aim for a comprehensive solution in one framework.&lt;/p&gt;

&lt;h1&gt;
  
  
  7 Semantic-UI
&lt;/h1&gt;

&lt;p&gt;Semantic-UI is a relative newcomer to the world of frameworks, but it is already well on its way to become one of the most widely used front-end frameworks worldwide. It is distinguished by its simple functioning and usefulness as well as its intuitive user interface. Because it uses regular language, the codes are self-explanatory.&lt;/p&gt;

&lt;p&gt;It implies that newcomers who are relatively inexperienced in the world of coding may easily understand the framework. Additionally, it facilitates a more efficient development process due to the integration of several third-party libraries.&lt;/p&gt;

&lt;p&gt;When to use:&lt;/p&gt;

&lt;p&gt;A technology called Semantic-UI allows for a very lightweight user interface.&lt;/p&gt;

&lt;p&gt;When not to use:&lt;/p&gt;

&lt;p&gt;Semantic-UI isn’t advised if you have a team of novices who are less familiar with javascript because it necessitates the capacity to create adjustments in the programme without relying on the pre-made functions.&lt;/p&gt;

&lt;h1&gt;
  
  
  8 Foundation
&lt;/h1&gt;

&lt;p&gt;Few frontend frameworks that were suitable even for novices have been seen thus far. With Foundation, though, things are very different. It was created by Zurb and is only appropriate for enterprise-level creation of responsive and agile websites. For beginners, utilising Foundation to start creating applications is advanced and difficult.&lt;/p&gt;

&lt;p&gt;It includes fast mobile rendering capabilities, GPU acceleration for incredibly smooth animations, and data-interchange features that load light chunks for mobile devices and hefty sections for bigger devices. Working on independent projects will help you become more familiar with the Foundation’s structure and better prepare you to handle its intricacies if you want to begin using it. Mozilla, eBay, Microsoft, and more companies use it.&lt;/p&gt;

&lt;p&gt;When to use&lt;/p&gt;

&lt;p&gt;If you are looking for styled CSS components, open-source, and mobile-friendly front end framework, Foundation beats the other options.&lt;/p&gt;

&lt;p&gt;When not to use&lt;/p&gt;

&lt;p&gt;Not suitable for beginners since it is tough to modify the code and increases the complexity because of its customization capability.&lt;/p&gt;

&lt;h1&gt;
  
  
  9 Svelte
&lt;/h1&gt;

&lt;p&gt;The most recent frontend framework is called Svelte. In contrast to frameworks like React and Vue, the framework has made a difference by moving the work into a compilation phase rather than the browser. It updates the document object model in sync with the application’s state by writing the code necessary to do so.&lt;/p&gt;

&lt;p&gt;When to use:&lt;/p&gt;

&lt;p&gt;The framework is best suitable for small app projects and with a small team. Because it doesn’t have a bigger support community, it is better not to use it for complex projects.&lt;/p&gt;

&lt;p&gt;When not to use:&lt;/p&gt;

&lt;p&gt;It is better not to use Svelte for bigger projects currently because the frameworks lack enough tooling and community. It is hard to find answers to the questions / bugs that may appear later in the development because of the small community.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
These are some of the top frontend frameworks I would suggest based on my experience creating everything from MVPs to large-scale projects. But I think you now know which framework to choose based on the requirements of your project.&lt;/p&gt;

&lt;p&gt;You can be unsure about the technology because there are many frontend framework solutions available. Understanding them, gaining experience with each, and making a decision among them are not simple tasks.&lt;/p&gt;

&lt;p&gt;When selecting a framework for a project that is created from scratch, I personally enjoy drawing on the knowledge of Simform’s frontend engineers. The nicest thing is that, even at the basic level, practically all frameworks can be picked up quickly. You should pick the frontend framework with the help of your most experienced frontend developer, who can weigh the advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;Frontend&lt;br&gt;
Development&lt;br&gt;
Developer&lt;br&gt;
Front End Develo&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Top 10 Mistakes to Avoid When Using React</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Sat, 12 Aug 2023 15:29:04 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/top-10-mistakes-to-avoid-when-using-react-2631</link>
      <guid>https://dev.to/certifieddev19960101/top-10-mistakes-to-avoid-when-using-react-2631</guid>
      <description>&lt;p&gt;React has quickly become the most popular front-end framework in the tech world, used by big tech companies such as Facebook, Netflix, Airbnb, and many more. React developers are in high demand, and the demand continues to grow.&lt;/p&gt;

&lt;p&gt;Today, we’ll explore the top 10 mistakes React developers make — and how to fix them.&lt;/p&gt;

&lt;p&gt;We’ll cover:&lt;/p&gt;

&lt;p&gt;Not creating enough components&lt;br&gt;
Modifying the state directly&lt;br&gt;
Passing a number as a string when passing props&lt;br&gt;
Not using key on a listing component&lt;br&gt;
Forgetting that setState is asynchronous&lt;br&gt;
Using Redux too much&lt;br&gt;
Creating and using God components&lt;br&gt;
Not following the React folder structure&lt;br&gt;
Sending props as strings (instead of numbers)&lt;br&gt;
Forgetting to start a component name with a capital letter&lt;br&gt;
What to learn next&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Not creating enough components
A common mistake that React developers make is that they don’t create enough components. With React, you’re able to create large components that execute many tasks, but it’s better to keep components small, with one component corresponding to one function. Not only does it save you time, but it also helps you with debugging since you know which components are associated with any errors that may arise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s take a look at an example of the TodoList component:&lt;/p&gt;

&lt;p&gt;// ./components/TodoList.js&lt;/p&gt;

&lt;p&gt;import React from 'react';&lt;/p&gt;

&lt;p&gt;import { useTodoList } from '../hooks/useTodoList';&lt;br&gt;
import { useQuery } from '../hooks/useQuery';&lt;br&gt;
import TodoItem from './TodoItem';&lt;br&gt;
import NewTodo from './NewTodo';&lt;/p&gt;

&lt;p&gt;const TodoList = () =&amp;gt; {&lt;br&gt;
  const { getQuery, setQuery } = useQuery();&lt;br&gt;
  const todos = useTodoList();&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      &lt;ul&gt;

        {todos.map(({ id, title, completed }) =&amp;gt; (
          
        ))}
        
      &lt;/ul&gt;
&lt;br&gt;
      &lt;br&gt;
        Highlight Query for incomplete items:&lt;br&gt;
         setQuery(e.target.value)} /&amp;gt;&lt;br&gt;
      &lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
};

&lt;p&gt;export default TodoList;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modifying the state directly
In React, the state should be immutable. If you modify the state directly, it’ll cause performance issues that are difficult to fix.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s look at an example:&lt;/p&gt;

&lt;p&gt;const modifyPetsList = (element, id) =&amp;gt; {&lt;br&gt;
  petsList[id].checked = element.target.checked;&lt;br&gt;
  setPetsList(petsList);&lt;br&gt;
};&lt;br&gt;
You want to update the checked key of an object in an array based on the state of a checkbox, but you have a problem. React can’t observe and trigger re-rendering because the object is being changed with the same reference.&lt;/p&gt;

&lt;p&gt;To fix this, you can either use the setState() method or the useState() hook. Either of these methods will ensure that your changes are acknowledged by React and your DOM is correctly re-rendered.&lt;/p&gt;

&lt;p&gt;Let’s rewrite the previous example and use the useState() method.&lt;/p&gt;

&lt;p&gt;Note: You could also use map() and spread syntax to avoid mutating other state values.&lt;/p&gt;

&lt;p&gt;const modifyPetsList = (element, id) =&amp;gt; {&lt;br&gt;
  const { checked } = element.target;&lt;br&gt;
  setpetsList((pets) =&amp;gt; {&lt;br&gt;
    return pets.map((pet, index) =&amp;gt; {&lt;br&gt;
      if (id === index) {&lt;br&gt;
        pet = { ...pet, checked };&lt;br&gt;
      }&lt;br&gt;
      return pet;&lt;br&gt;
    });&lt;br&gt;
  });&lt;br&gt;
};&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Passing a number as a string when passing props
Passing a number as a string when passing props can lead to issues in a React program.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s start with an example:&lt;/p&gt;

&lt;p&gt;class Arrival extends React.Component {&lt;br&gt;
  render() {&lt;br&gt;
    return (&lt;br&gt;
      &lt;/p&gt;
&lt;h1&gt;
&lt;br&gt;
        Hi! You arrived {this.props.position === 1 ? "first!" : "last!"} .&lt;br&gt;
      &lt;/h1&gt;
&lt;br&gt;
    );&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
In this example, the component expects the position as a prop and declares that the position should be a number. Since you’re making a strict comparison, anything that’s not a number or not exactly equal to 1 would trigger the second expression and print “last!”.

&lt;p&gt;To fix this, you should insert curly brackets around the input like this:&lt;/p&gt;

&lt;p&gt;const element = ;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Not using key on a listing component
Let’s say you need to render a list of items and your code looks something like this:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;const lists = ['cat', 'dog', 'fish’];&lt;/p&gt;

&lt;p&gt;render() {&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;ul&gt;

      {lists.map(listNo =&amp;gt;
        &lt;li&gt;{listNo}&lt;/li&gt;)}
    &lt;/ul&gt;
&lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
If you’re working with a smaller app, this could work. But when working with large lists, you’ll run into rendering problems when wanting to modify or delete an item from the list.

&lt;p&gt;React tracks all of the list elements on the Document Object Model (DOM). React wouldn’t know what has changed in your list without this record.&lt;/p&gt;

&lt;p&gt;To fix this, you need to add keys to all of your list elements. Keys give each element a unique identity, which helps React determine which items have been added, removed, modified, etc.&lt;/p&gt;

&lt;p&gt;Here’s how to do this:&lt;/p&gt;

&lt;ul&gt;
  {lists.map(listNo =&amp;gt;
    &lt;li&gt;{listNo}&lt;/li&gt;)}
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Forgetting that setState is asynchronous
It’s easy to forget that the state in React is asynchronous. It’s something that even the most seasoned React developers forget.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Being asynchronous means that any modifications you make don’t take effect immediately (and may take effect on the next render). React automatically batches update calls to improve performance. If you access a state value right after setting it, you might not get the most accurate result.&lt;/p&gt;

&lt;p&gt;Let’s look at an example:&lt;/p&gt;

&lt;p&gt;handlePetsUpdate = (petCount) =&amp;gt; {&lt;br&gt;
  this.setState({ petCount });&lt;br&gt;
  this.props.callback(this.state.petCount); // Old value&lt;br&gt;
};&lt;br&gt;
You can fix this by giving an optional second parameter to setState(), which will act as a callback function. The callback function will be called right after you update the state with your change.&lt;/p&gt;

&lt;p&gt;handlePetsUpdate = (petCount) =&amp;gt; {&lt;br&gt;
  this.setState({ petCount }, () =&amp;gt; {&lt;br&gt;
    this.props.callback(this.state.petCount); // Updated value&lt;br&gt;
  });&lt;br&gt;
};&lt;br&gt;
Note: The same thing is true for useState(), except they don’t have a similar callback argument to setState(). Instead, you would use the useEffect() hook to get the same result.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using Redux too much
With bigger React apps, many developers use Redux to manage global state. While Redux is useful, you don’t need to use it to manage every state in your apps.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have an app that doesn’t have any parallel-level components that need to exchange information, you have no need to add an extra library to your project. It’s recommended to use a local state method or useState over Redux when you use a form component and want to check the state of a check button every time it’s accessed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Creating and using God components&lt;br&gt;
God components are monolithic and not reusable. They’re referred to as an “anti-pattern” in React. You shouldn’t build an entire page with all of your UI elements crammed into one component. You should instead take the time to outline the different interconnected parts of your app and make them into their own components. When you separate components this way, all parts of your app are easier to maintain and restructure when needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not following the ReactJS folder structure&lt;br&gt;
The projects you create aren’t just made for current development. They most likely will need to be maintained or manipulated in the future. The folder structure is very important when considering future possibilities for a project.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s take a look at a standard folder structure followed by the ReactJS community:&lt;/p&gt;

&lt;p&gt;Standard React JS Folder Structure&lt;br&gt;
When navigating into any existing projects, it’s useful to have separate places for containers, assets, and components. It’s also useful to follow naming conventions to help with readability and organization. This helps you easily identify the purpose of any code written in your projects.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sending props as strings (instead of numbers)
React developers with experience writing a lot of HTML find it natural to write something like this:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;br&gt;
This value prop will actually be sent to MyComponent as a string. If you do need it as a number, you can fix this issue by using something like the parseInt() function or inserting curly brackets instead of quotation marks.&lt;/p&gt;



&lt;ol&gt;
&lt;li&gt;Forgetting to start a component name with a capital letter
Forgetting to start component names with capital letters is a small mistake that’s very easy to make. In JSX, a component that begins with a lowercase letter compiles down to an HTML element.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s say you wrote something like this:&lt;/p&gt;

&lt;p&gt;class demoComponentName extends React.Component {&lt;br&gt;
}&lt;br&gt;
This will cause an error that tells you that if you meant to render a React component, you need to start its name with an uppercase letter.&lt;/p&gt;

&lt;p&gt;This mistake has an easy fix, which is starting component names with capital letters like this:&lt;/p&gt;

&lt;p&gt;class DemoComponentName extends React.Component {&lt;br&gt;
}&lt;br&gt;
What to learn next&lt;br&gt;
Now that we’ve explored the top ten mistakes React developers make, it’s time to start working with React and applying the skills you learned here today. React developers are in high demand, so adding React to your skillset is a wise career investment.&lt;/p&gt;

&lt;p&gt;Some recommended concepts to work with next are:&lt;/p&gt;

&lt;p&gt;Libraries in React&lt;br&gt;
Initializing Firebase in React&lt;br&gt;
App development with global state in React&lt;br&gt;
Etc.&lt;br&gt;
Happy learning!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>6 ways to get data in React</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Thu, 10 Aug 2023 01:03:18 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/6-ways-to-get-data-in-react-5854</link>
      <guid>https://dev.to/certifieddev19960101/6-ways-to-get-data-in-react-5854</guid>
      <description>&lt;p&gt;Data fetching is a core aspect of any React application. It is important for React developers to understand the different methods of data fetching and which use cases work best for them.&lt;/p&gt;

&lt;p&gt;But first, let’s understand JavaScript Promises&lt;br&gt;
Simply put, a promise is a JavaScript object that will yield a value sometime in the future. This usually applies to asynchronous operations (such as data fetching).&lt;/p&gt;

&lt;p&gt;A promise has three states:&lt;/p&gt;

&lt;p&gt;Pending: where the promise is still in progress&lt;br&gt;
Fulfilled: where the promise resolves successfully and returns a value&lt;br&gt;
Rejected: Promise failed with error&lt;br&gt;
If a promise is fulfilled or rejected, it’s resolved . Promises have different methods to do different things depending on the result. These methods are discussed in more detail in the next section.&lt;/p&gt;

&lt;p&gt;Method #1 — Using Promise Method Get API&lt;br&gt;
The Fetch API provides a global fetch() method that enables developers to fetch data in a straightforward way. Prior to fetch(), the traditional approach was to use XMLHttpRequest(). (This method is not covered in this article because fetch() has been superseded by a more powerful and flexible feature set.)&lt;/p&gt;

&lt;p&gt;The fetch() method takes one parameter, the URL to request, and returns a promise. The second optional parameter options is an array of attributes. The return value of fetch() can be JSON or XML (an array of objects or a single object). With no options argument, fetch() will always make a GET request.&lt;/p&gt;

&lt;p&gt;The first method is what you’ll typically see in simple data fetching use cases, and is often the first result when browsing API documentation. As mentioned earlier, we fetch data from an API that returns a random image of a dog, and render that image on the screen. Before making the request, we wrap the code in a useEffecthook with an empty dependencies array so that fetch()the method is only run when the component is initially installed.&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    fetch(URL)&lt;br&gt;
      // syntax for handling promises&lt;br&gt;
      .then((res) =&amp;gt; {&lt;br&gt;
        // check to see if response is okay&lt;br&gt;
        if (res.ok) {&lt;br&gt;
          // if okay, take JSON and parse to JavaScript object&lt;br&gt;
          return res.json();&lt;br&gt;
        }&lt;br&gt;
        throw res;&lt;br&gt;
      })&lt;br&gt;
      //  .json() returns a promise as well&lt;br&gt;
      .then((data) =&amp;gt; {&lt;br&gt;
        console.log(data);&lt;br&gt;
        // setting response as the data state&lt;br&gt;
        setData(data);&lt;br&gt;
      })&lt;br&gt;
      // if res is not okay the res is thrown here for error&lt;br&gt;
      .catch((err) =&amp;gt; {&lt;br&gt;
        console.error(&lt;code&gt;Error: ${err}&lt;/code&gt;);&lt;br&gt;
        // setting the error state&lt;br&gt;
        setError(err);&lt;br&gt;
      })&lt;br&gt;
      //  regardless if promise resolves successfully or not we remove loading state&lt;br&gt;
      .finally(() =&amp;gt; {&lt;br&gt;
        setLoading ( false );&lt;br&gt;
      });&lt;br&gt;
  }, []);&lt;br&gt;
In , we call the method and pass in the URL of the API endpoint. In this method, we use the , , method of the promise object (recall that returns a promise). We use this method and pass in a callback function to check if the response is OK. If the response is OK, we take the returned JSON data and use the method to parse it into a JavaScript object. If the response is not normal, we will error.&lt;/p&gt;

&lt;p&gt;Since the .json()method also returns a promise, we can chain another .then()and pass a function to set the state of the data, which is then used elsewhere in the component. In our example, the external API returns an object with a url property (which will be used as srcour image).&lt;/p&gt;

&lt;p&gt;Continuing through the chain, the next part is .catch()to arrange for a function to be called when the promise is rejected. This also returns another promise, which we can then chain .finally()which will be called regardless of whether the promise is resolved (resolved or rejected). This .finally()approach allows us to avoid duplicating code in and .then(), .catch()making it a good place to remove loading state in our example.&lt;/p&gt;

&lt;p&gt;Approach #2 — Libraries with Promise methods Axios&lt;br&gt;
Axios is a popular HTTP client library for efficient data fetching. It can be easily installed into React applications via npm or other package managers. Using Axios is an alternative to the Fetch API, which has some advantages if you don’t mind installing external libraries.&lt;/p&gt;

&lt;p&gt;The second example will be very close to the code of the first example, using the same promise method to handle the promise state and response. After fetch()importing the Axios library into our component, we can use axios.get()a method that can pass a URL to our external API endpoint instead. This returns a Promise, so we can take the same approach as Promise method chaining.&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    axios.get(URL)&lt;br&gt;
      // syntax for handling promises&lt;br&gt;
      .then((res) =&amp;gt; {&lt;br&gt;
        console.log(res.data);&lt;br&gt;
        // axios converts json to object for us (shortens our code)&lt;br&gt;
        setData(res.data);&lt;br&gt;
      })&lt;br&gt;
      // axios takes care of error handling for us instead of checking manually&lt;br&gt;
      .catch((err) =&amp;gt; {&lt;br&gt;
        console.error(&lt;code&gt;Error: ${err}&lt;/code&gt;);&lt;br&gt;
        // setting the error state&lt;br&gt;
        setError(err);&lt;br&gt;
      })&lt;br&gt;
      //  regardless if promise resolves successfully or not we remove loading state&lt;br&gt;
      .finally(() =&amp;gt; {&lt;br&gt;
        setLoading ( false );&lt;br&gt;
      });&lt;br&gt;
  }, []);&lt;br&gt;
The obvious difference between the code for the Fetch API and this Axios method is that with Axios we only need one, because Axios converts the .then()JSON to JavaScript objects for us (shortening our code). Also, we no longer write conditions to manually throw errors, because Axios will throw 400 and 500 range errors for you (shortening our code again).&lt;/p&gt;

&lt;p&gt;Approach #3 — Asynchronous functions (async/await)&lt;br&gt;
In this example, we’ll abandon the promise chaining we used in the previous two examples and instead introduce a more modern approach to writing asynchronous, promise-based code. This approach can be used with any fetching mechanism of your choice, but for this example we’ll stick with the Axios library.&lt;/p&gt;

&lt;p&gt;The third example sets up the component in a similar fashion to the previous example by importing the Axios library and then wrapping the code for fetching the data in useEffecta with an empty dependencies array. In useEffect, we use the keyword to create an asynchronous function async, and then within that function we have three separate parts - try, catchand finally. This try/catch approach is used to handle errors in JavaScript. The code inside the block tryis executed first, if any errors are thrown, they will be "caught" in the block, catchand the inner code will be executed. Finally, the finallyblock will always be executed after the flow has passed the try/catch.&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    // create async function b/c cannot use async in useEffect arg cb&lt;br&gt;
    const fetchData = async () =&amp;gt; {&lt;br&gt;
    //   with async/await use the try catch block syntax for handling&lt;br&gt;
      try {&lt;br&gt;
        // using await to make async code look sync and shorten &lt;br&gt;
        const res = await axios.get(URL);&lt;br&gt;
        setData(res.data);&lt;br&gt;
      } catch (err) {&lt;br&gt;
        console.error(&lt;code&gt;Error: ${err}&lt;/code&gt;);&lt;br&gt;
        // setting the error state&lt;br&gt;
        setError(err);&lt;br&gt;
      } finally {&lt;br&gt;
        setLoading ( false );&lt;br&gt;
      }&lt;br&gt;
    };&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetchData ();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}, []);&lt;br&gt;
In this example, the try block creates a variable called res (short for response) that uses the async keyword. This allows the code to look synchronous (shorter and easier on the eyes). In this example, axios.get(URL) is “waiting” until it stabilizes. If the promise is fulfilled, then we set the data into the state. If the promise is rejected (throws an error), it goes into the catch block.&lt;/p&gt;

&lt;p&gt;Method #4 — Create a “ useFetch" custom React Hook&lt;br&gt;
The fourth approach is to create our own custom React hook, call useFetchit that can be reused in different components in our application, and remove the bulky fetching code from each component. This example is really just taking the fourth example (using the same techniques of the Axios library and async/await) and moving that code into its own custom hook.&lt;/p&gt;

&lt;p&gt;To do this, we create a function called useFetch.js. Then we useEffectadd all the code from the previous example, along with the different states we're tracking, into the function useFetch. Finally, this function will return an object containing each state, which is then useFetchaccessed where the hook is called. Our useFetchhook will also accept one parameter, the URL , to allow for more reusability and the possibility to make fetch requests to different endpoints.&lt;/p&gt;

&lt;p&gt;const useFetch = (url) =&amp;gt; {&lt;br&gt;
  const [data, setData] = useState(null);&lt;br&gt;
  const [ loading , setLoading ] =  useState ( true );&lt;br&gt;
  const [error, setError] = useState(null);&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    // create async function b/c cannot use asyc in useEffect arg cb&lt;br&gt;
    const fetchData = async () =&amp;gt; {&lt;br&gt;
      //   with async/await use the try catch block syntax for handling&lt;br&gt;
      try {&lt;br&gt;
        // using await to make async code look sync and shorten&lt;br&gt;
        const res = await axios.get(url);&lt;br&gt;
        setData(res.data);&lt;br&gt;
      } catch (err) {&lt;br&gt;
        console.error(&lt;code&gt;Error: ${err}&lt;/code&gt;);&lt;br&gt;
        // setting the error state&lt;br&gt;
        setError(err);&lt;br&gt;
      } finally {&lt;br&gt;
        setLoading ( false );&lt;br&gt;
      }&lt;br&gt;
    };&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetchData ();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}, []);&lt;/p&gt;

&lt;p&gt;return {&lt;br&gt;
    data,&lt;br&gt;
    loading,&lt;br&gt;
    error,&lt;br&gt;
  };&lt;br&gt;
};&lt;br&gt;
Finally, we import this new custom hook into the component that will use it, and call it like any other React hook. As you can see, this greatly helps with code readability and shortens our component.&lt;/p&gt;

&lt;p&gt;The final point of this approach is that you can also install external libraries instead of creating your own custom hooks. A popular library react-fetch-hook has very similar functionality to the hook we just built.&lt;/p&gt;

&lt;p&gt;Method #5 — React Querying the library&lt;br&gt;
One of the most modern and powerful ways to fetch data in React is by using the React Query library. It has many features beyond simple data fetching, but for this example, we will learn how to simply fetch data from the same example external API.&lt;/p&gt;

&lt;p&gt;Once installed and imported, React Query provides a number of custom hooks that can be reused across our components in a very clean way. In this example, we import QueryClient from and then wrap our application with a provider and pass the QueryClientProvider instance as a property to the wrapper. This enables us to use the library in our application.&lt;/p&gt;

&lt;p&gt;To make this simple GET request, we import and use useQueryhooks. Unlike the previous example using a custom hook, we pass in two parameters. The first required parameter is queryKey , which is used as a reference key for this specific query. The second required parameter is queryFn , which is the function that the query will use to request data. We'll use this query function and then use the Fetch API and promise method syntax for the initial fetch instead of just passing a simple URL as in our previous custom hook example. ( This hook has many other optional parameters. )&lt;/p&gt;

&lt;p&gt;const { isLoading, error, data } = useQuery("dogData", () =&amp;gt; fetch(URL).then((res) =&amp;gt; res.json()));&lt;br&gt;
isLoadingFrom here, React Query will do all the extra work behind the scenes, in this case we can destructure , error, and from this hook call to use datain our application, although we can access many other values ​​as well.&lt;/p&gt;

&lt;p&gt;In a larger example than our current Dog Image API example, the power and advantages of using React Query are evident. Some additional features to mention include: caching, updating “stale” data in the background, and other performance-related benefits.&lt;/p&gt;

&lt;p&gt;Method #6 — Redux Toolkit RTK Queries&lt;br&gt;
The last method of this article is to use Redux Toolkit’s RTK Query for data acquisition. It’s very common for applications to use Redux for state management. If your company or your current side project is currently using Redux, a good option is to use RTK queries to fetch data, as it offers similar simplicity and benefits to React queries.&lt;/p&gt;

&lt;p&gt;To start using RTK queries wherever your Redux code is stored, create a rtkQueryService.jsfile to set up data fetching. After creation, you add the service to your Redux store, and assuming you're already using Redux, you'll already have a store component that contains your application.&lt;/p&gt;

&lt;p&gt;From here, it’s very similar to using custom hooks with React Query methods, you import and then use query hooks and deconstruct data, errorthen isLoadingbe able to use in your components.&lt;/p&gt;

&lt;p&gt;const { data, error, isLoading } = useGetDogQuery();&lt;br&gt;
As you can see, Redux has a lot of settings, so this might not be the best approach for our use case, but if you’re already using Redux in a React app and want a simple and modern way of getting data, RTK Query might be great Valuable this also provides benefits like caching.&lt;/p&gt;

&lt;p&gt;final thoughts&lt;br&gt;
If you get to this point, support you! The purpose of this article is to introduce some of the different data fetching methods for those learning React. This is a centralized place to compare with the same use case for better understanding. My goal is not to make a statement or go into details about the “best” approach.&lt;/p&gt;

&lt;p&gt;Also, there are other current data fetching methods not mentioned here, and I’m sure others will emerge as the React ecosystem grows. That said, I believe this article provides a solid foundation for understanding the field. I hope you find this useful!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>5 projects to master Front End Development</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Tue, 08 Aug 2023 15:00:28 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/5-projects-to-master-front-end-development-5768</link>
      <guid>https://dev.to/certifieddev19960101/5-projects-to-master-front-end-development-5768</guid>
      <description>&lt;p&gt;If you are starting on the journey to becoming a Front End Developer, once you get the basics down, you might want to develop projects as the best way to learn any skill is to try creating something hands-on. This article is for anyone trying to take their skills to the next level, as well as for people who is at a loss for project ideas.&lt;/p&gt;

&lt;p&gt;Here are five project ideas to help you out, according to no order.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Real-Time Chat App
A Real-Time chat application sends and shows messages to a recipient instantly without any page refresh.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is a very lucrative project to have in your portfolio as it showcases that you have experience working with real-time data as well as authentication. If you are a Full-Stack Developer, you might also want to create the backend for the application for some extra brownie points in the eyes of the person checking it out.&lt;/p&gt;

&lt;p&gt;Demo&lt;/p&gt;

&lt;p&gt;Web-app: &lt;a href="https://smartsapp-ba40f.firebaseapp.com"&gt;https://smartsapp-ba40f.firebaseapp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub - ruppysuppy/SmartsApp: 💬📱 An End to End Encrypted Cross Platform messenger app.&lt;br&gt;
A fully cross-platform messenger app with End to End Encryption (E2EE). NOTE: The features shown in the demo is not…&lt;br&gt;
github.com&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;E-Commerce Store
E-commerce stores allow users to buy and sell goods or services using the internet and transfers money and data to execute these transactions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This project also involves authentication as well as keeping track of a user’s previous orders, cart, etc. resulting in a complex project, which tells the viewer you can solve complex development problems.&lt;/p&gt;

&lt;p&gt;Demo&lt;/p&gt;

&lt;p&gt;Web-app: &lt;a href="https://pizza-man-61510.web.app/"&gt;https://pizza-man-61510.web.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub - ruppysuppy/Pizza-Man: 🍕🛒 An e-commerce website to order pizza online&lt;br&gt;
An E-Commerce website for ordering Pizza Online NOTE: The features shown in the demo is not exhaustive. Only the core…&lt;br&gt;
github.com&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Weather Report App
A Weather Report App provides the user with current weather details and forecasts as well for the future.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This project is probably the easiest one on the list. You only need to use a third-party API like Open Weather Map or Weather API. It shows the viewer that you can work with external APIs.&lt;/p&gt;

&lt;p&gt;Demo&lt;/p&gt;

&lt;p&gt;GitHub - ruppysuppy/The-WeatherMan-Project: 🌞☁️ Get Local and International weather forecasts from…&lt;br&gt;
🌞☁️ Get Local and International weather forecasts from the most accurate Weather Forecasting Technology featuring up…&lt;br&gt;
github.com&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cross-Platform App
Cross-Platform Applications are apps developed to function on multiple Operating Systems from the same code base.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Being well adapted at Cross-Platform Development is highly in demand these days as companies want to reduce the cost involved in application development, and what’s a better way to do it than make an application once and use it on several platforms?&lt;/p&gt;

&lt;p&gt;Demo&lt;/p&gt;

&lt;p&gt;GitHub - ruppysuppy/SmartsApp: 💬📱 An End to End Encrypted Cross Platform messenger app.&lt;br&gt;
A fully cross-platform messenger app with End to End Encryption (E2EE). NOTE: The features shown in the demo is not…&lt;br&gt;
github.com&lt;/p&gt;

&lt;p&gt;GitHub - ruppysuppy/UnHook: 💻👨‍💻 Cross Platform Desktop App to remind you to Unhook yourself…&lt;br&gt;
If you are one of the rare breed of people who call themselves programmers, you must have faced the following sitation…&lt;br&gt;
github.com&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Personal Portfolio
Since you just completed 4 projects mentioned above, you will definitely need a place to showoff how cool your projects are. Personal Portfolio is the go-to place to do just that, you can also list out your experience, achievements, and any other relevant information.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you have a desire to build your personal brand, then a website that can promote your work is a must. This is just the place you can bring out your inner artist and design it to your heart’s content. Not an artistic person? Draw ideas from templates or simply use one.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>3 Common Mistakes to Avoid When Handling Events in React</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Thu, 03 Aug 2023 13:09:46 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/3-common-mistakes-to-avoid-when-handling-events-in-react-31jj</link>
      <guid>https://dev.to/certifieddev19960101/3-common-mistakes-to-avoid-when-handling-events-in-react-31jj</guid>
      <description>&lt;p&gt;In React apps, event listeners or observers perform certain actions when specific events occur. While it’s pretty easy to create event listeners in React, there are common pitfalls you need to avoid to prevent confusing errors. These mistakes are made most often by beginners, but it’s not rare for them to be the reason for one of your debugging sessions as a reasonably experienced developer.&lt;/p&gt;

&lt;p&gt;In this article, we’ll be exploring some of these common mistakes, and what you should do instead.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accessing state variables without dealing with updates
Take a look at this simple React app. It’s essentially a basic stopwatch app, counting up indefinitely from zero.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useState, useEffect } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;br&gt;
  useEffect(() =&amp;gt; {&lt;br&gt;
    const timer = setInterval(() =&amp;gt; {&lt;br&gt;
      setTime(time + 1);&lt;br&gt;
    }, 1000);&lt;br&gt;
    return () =&amp;gt; {&lt;br&gt;
      window.clearInterval(timer);&lt;br&gt;
    }&lt;br&gt;
  }, []);&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
However, when we run this app, the results are not what we’d expect:

&lt;p&gt;This happens because the time state variable being referred to by the setInterval() callback/closure refers to the stale state that was fresh at the time when the closure was defined.&lt;/p&gt;

&lt;p&gt;The closure is only able to access the time variable in the first render (which had a value of 0) but can't access the new time value in subsequent renders. JavaScript closure remembers the variables from the place where it was defined.&lt;/p&gt;

&lt;p&gt;The issue is also due to the fact that the setInterval() closure is defined only once in the component.&lt;/p&gt;

&lt;p&gt;The time variable from the first render will always have a value of 0, as React doesn't mutate a state variable directly when setState is called, but instead creates a new variable containing the new state. So when the setInterval closure is called, it only ever updates the state to 1.&lt;/p&gt;

&lt;p&gt;Here are some ways to avoid this mistake and prevent unexpected problems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pass function to setState
One way to avoid this error is by passing a callback to the state updater function (setState) instead of passing a value directly. React will ensure that the callback always receives the most recent state, avoiding the need to access state variables that might contain old state. It will set the state to the value the callback returns.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s how we apply this for our example:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useState, useEffect } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;br&gt;
  useEffect(() =&amp;gt; {&lt;br&gt;
    const timer = setInterval(() =&amp;gt; {&lt;br&gt;
      // 👇 Pass callback&lt;br&gt;
      setTime((prevTime) =&amp;gt; prevTime + 1);&lt;br&gt;
    }, 1000);&lt;br&gt;
    return () =&amp;gt; {&lt;br&gt;
      window.clearInterval(timer);&lt;br&gt;
    }&lt;br&gt;
  }, []);&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}

&lt;p&gt;Now the time state will be incremented by 1 every time the setInterval() callback runs, just like it's supposed to.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Event listener re-registration
Another solution is to re-register the event listener with a new callback every time the state is changed, so the callback always accesses the fresh state from the enclosing scope.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We do this by passing the state variable to useEffect's dependencies array:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useState, useEffect } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    const timer = setInterval(() =&amp;gt; {&lt;br&gt;
      setTime(time + 1);&lt;br&gt;
    }, 1000);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return () =&amp;gt; {
  window.clearInterval(timer);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}, [time]);&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
Every time the time state is changed, a new callback accessing the fresh state is registered with setInterval(). setTime() is called with the latest time state added to 1, which increments the state value.

&lt;ol&gt;
&lt;li&gt;Registering event handler multiple times
This is a mistake frequently made by developers new to React hooks and functional components. Without a basic understanding of the re-rendering process in React, you might try to register event listeners like this:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useState } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;/p&gt;

&lt;p&gt;setInterval(() =&amp;gt; {&lt;br&gt;
    setTime((prevTime) =&amp;gt; prevTime + 1);&lt;br&gt;
  }, 1000);&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
Or you might put it in a useEffect hook like this:

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useState } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    setInterval(() =&amp;gt; {&lt;br&gt;
      setTime((prevTime) =&amp;gt; prevTime + 1);&lt;br&gt;
    }, 1000);&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
If you do have a basic understanding of this, you should be able to already guess what this will lead to on the web page.

&lt;p&gt;What’s happening?&lt;/p&gt;

&lt;p&gt;What’s happening is that in a functional component, code outside hooks, and outside the returned JSX markup is executed every time the component re-renders.&lt;/p&gt;

&lt;p&gt;Here’s a basic breakdown of what happens in a timeline:&lt;/p&gt;

&lt;p&gt;1st render: listener 1 registered&lt;br&gt;
1 second after listener 1 registration: time state updated, causing another re-render)&lt;br&gt;
2nd render: listener 2 registered.&lt;br&gt;
Listener 1 never got de-registered after the re-render, so…&lt;br&gt;
1 second after last listener 1 call: state updated&lt;br&gt;
3rd render: listener 3 registered.&lt;br&gt;
Listener 2 never got de-registered after the re-render, so…&lt;br&gt;
1 second after listener 2 registration: state updated&lt;br&gt;
4th render: listener 4 registered.&lt;br&gt;
1 second after last listener 1 call: state updated&lt;br&gt;
5th render: listener 5 registered.&lt;br&gt;
1 second after last listener 2 call: state updated&lt;br&gt;
6th render: listener 6 registered.&lt;br&gt;
Listener 3 never got de-registered after the re-render, so…&lt;br&gt;
1 second after listener 3 registration: state updated.&lt;br&gt;
7th render: listener 7 registered…&lt;br&gt;
Eventually, things spiral out of control as hundreds and then thousands (and then millions) of callbacks are created, each running at different times within the span of a second, incrementing the time by 1.&lt;/p&gt;

&lt;p&gt;The fix for this is already in the first example in this article — put the event listener in the useEffect hook, and make sure to pass an empty dependencies array ([]) as the second argument.&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useEffect, useState } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    setInterval(() =&amp;gt; {&lt;br&gt;
      setTime((prevTime) =&amp;gt; prevTime + 1);&lt;br&gt;
    }, 1000);&lt;br&gt;
  }, []);&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
useEffect runs after the first render and whenever any of the values in its dependencies array change, so passing an empty array makes it run only on the first render.

&lt;p&gt;The time increases steadily now, but as you can see in the demo, it goes up by 2 seconds, instead of 1 second in our very first example. This is because in React 18 strict mode, all components mount, unmount, then mount again. so useEffect runs twice even with an empty dependencies array, creating two listeners that update the time by 1 every second.&lt;/p&gt;

&lt;p&gt;We can fix this issue by turning off strict mode, but we’ll see a much better way to do so in the next section.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Not unregistering event handler on component unmount.
What happened here was a memory leak. We should have ensured that any created event listener is unregistered when the component unmounts. So when React 18 strict mode does the compulsory unmounting of the component, the first interval listener is unregistered before the second listener is registered when the component mounts again. Only the second listener will be left and the time will be updated correctly every second — by 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can perform an action when the component unmounts by placing in the function useEffect optionally returns. So we use clearInterval to unregister the interval listener there.&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;import { useEffect, useState } from 'react';&lt;/p&gt;

&lt;p&gt;export default function App() {&lt;br&gt;
  const [time, setTime] = useState(0);&lt;br&gt;
  useEffect(() =&amp;gt; {&lt;br&gt;
    console.log('here');&lt;br&gt;
    const timer = setInterval(() =&amp;gt; {&lt;br&gt;
      setTime((prevTime) =&amp;gt; prevTime + 1);&lt;br&gt;
    }, 1000);&lt;br&gt;
    // 👇 Unregister interval listener&lt;br&gt;
    return () =&amp;gt; {&lt;br&gt;
      clearInterval(timer);&lt;br&gt;
    }&lt;br&gt;
  }, []);&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      Seconds: {time}&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
useEffect's cleanup function runs after every re-render, not only when the component unmounts. This prevents memory leaks that happen when an observable prop changes value without the observers in the component unsubscribing from the previous observable value.

&lt;p&gt;Conclusion&lt;br&gt;
Creating event listeners in React is pretty straightforward, you just need to be aware of these caveats, so you avoid unexpected errors and frustrating debugging spells. Avoid accessing stale state variables, don’t register more event listeners than required, and always unregister the event listener when the component unmounts.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>2023 Fastest Roadmap for ReactJS Junior Level - With Preparation Links</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Thu, 03 Aug 2023 13:07:12 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/2023-fastest-roadmap-for-reactjs-junior-level-with-preparation-links-1alp</link>
      <guid>https://dev.to/certifieddev19960101/2023-fastest-roadmap-for-reactjs-junior-level-with-preparation-links-1alp</guid>
      <description>&lt;p&gt;Frontend Roadmap with links to tutorials, practices and certificates.&lt;/p&gt;

&lt;p&gt;Photo by Lautaro Andreani on Unsplash&lt;br&gt;
Ihave gone through many roadmaps online and here is my list to become a frontend engineer as fast as possible. Sit tight and let’s start.&lt;/p&gt;

&lt;p&gt;Before we start&lt;br&gt;
Best Websites to learn from:&lt;/p&gt;

&lt;p&gt;Youtube: all free.&lt;br&gt;
Udemy: pay for everything, learn better.&lt;br&gt;
Coursera: certified.&lt;br&gt;
Egghead: simple explanation.&lt;br&gt;
Medium: read articles on different topics.&lt;br&gt;
IDE: VSCode&lt;/p&gt;

&lt;p&gt;Learning Technique: Pomodoro. You can install the Focus To-Do app on your phone, computer or Chrome as an extension.&lt;/p&gt;

&lt;p&gt;HTML and CSS&lt;br&gt;
These are essential technologies for every prospective developer to understand how you can build something using your computer.&lt;/p&gt;

&lt;p&gt;General knowledge: HTML in 100 Seconds, CSS in 100 Seconds&lt;br&gt;
Detailed: HTML &amp;amp; CSS Crash Course, HTML Crash Course by Mosh Hamedani&lt;br&gt;
Also, use w3schools.com to read about the common CSS and HTML features.&lt;/p&gt;

&lt;p&gt;The most important HTML tags: html, head, body, style, script, link, meta, base, div, h1-h6, p, span, i, b, hr, ul-ol, li, table (thead, tbody etc.), a, button, input (label), form, select (option), textarea, img, video .&lt;br&gt;
Should-be-known tags: iframe, header, main, aside, article, footer, nav, section, hr, br, map, svg, canvas, noscript, strong, audio .&lt;br&gt;
The most important CSS concepts: flex, grid, specificity, box model, margin-padding-border, Responsivity( @media queries), position, display (block, inline, inline-block), advanced selectors (pseudo element, pseudo class etc.), CSS optimizationHave a look at the link for all important concepts.&lt;br&gt;
Warm up your knowledge with games:&lt;br&gt;
Flexbox Froggy&lt;br&gt;
Grid Garden&lt;br&gt;
CSS Diner&lt;br&gt;
CSS Battle&lt;br&gt;
You can also write some responsive components like navigation, dropdown, card, form, circular loader, sidebar etc (Example snippets). Have a look at w3schools exercises&lt;br&gt;
Learn how to write readable code&lt;br&gt;
Towrite readable code, we must follow community best practices. SASS, BEM standard and Bootstrap 5 come to rescue us from writing unreadable code. They are easy to learn and even easier to work with.&lt;/p&gt;

&lt;p&gt;“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”&lt;/p&gt;

&lt;p&gt;― Martin Fowler&lt;/p&gt;

&lt;p&gt;SASS: Sass in 100 seconds, Complete SASS tutorial,&lt;br&gt;
BEM: By using the BEM standard you won't need to use complicated CSS selectors and your code will be faster to run. BEM in 6 mins, You Probably Need BEM CSS in Your Life (Tutorial).&lt;br&gt;
Bootstrap 5: It helps to write components faster and makes them readable. Bootstrap 5 tutorial&lt;br&gt;
Code something&lt;br&gt;
Use one of the 45 Figma Landing Pages and code it using the technologies mentioned above. Figma is a UI designing app and its usage is more common than others.&lt;/p&gt;

&lt;p&gt;PS.: Don’t forget to create a Figma account to access the built-in tools. See the image below:&lt;/p&gt;

&lt;p&gt;Learn Git&lt;br&gt;
Here you have coded a landing page. So you need to push it to your GitHub account. Create one and choose a distinctive username. Mine is nagibaba .&lt;/p&gt;

&lt;p&gt;Git in 100 seconds, Git and GitHub in 12 mins.&lt;/p&gt;

&lt;p&gt;Most important git commands: init, add, commit, push, pull, merge, checkout, status, log . These will be enough for a beginner. You can enhance your knowledge later.&lt;/p&gt;

&lt;p&gt;Javascript&lt;br&gt;
Weneed to focus on ES6 (ES 2015) for modern React development. In addition to ES6, it is crucial to understand the differences with ES5 (Old Javascript). Most browsers understand ES6. If not, modern development systems automatically compile ES6 and later versions to ES5 using Babel. So we don’t need to get into hassle with that process.&lt;/p&gt;

&lt;p&gt;JS in 100 seconds,&lt;br&gt;
Modern Javascript tutorial,&lt;br&gt;
Learn by reading, Javascript.info from basics to advanced (I prefer this).&lt;br&gt;
Javascript from beginner to expert (explains the differences between ES5 and old JS syntax together)&lt;br&gt;
FreeCodeCamp: Basic Javascript, ES6, Functional Programming&lt;br&gt;
Practice by coding online: &lt;a href="https://learnjavascript.online/"&gt;https://learnjavascript.online/&lt;/a&gt;&lt;br&gt;
Important concepts: Event loop (microtask, macrotask, queue, stack, web API), context, arrow function, closure and currying, hoisting, data types, variable types (var, let, const), strict mode, value vs reference, type coercion, DOM manipulation, destructuring and spread operator, call-apply-bind functions, Array manipulation, pure functions, higher-order functions, promises, scope, IIEF, == vs ===, mutability, lazy loading.&lt;/p&gt;

&lt;p&gt;Tip: The interviewer will most probably ask about synchronous and asynchronous functions and their order of execution.&lt;/p&gt;

&lt;p&gt;console.log(1)&lt;br&gt;
setTimeout(()=&amp;gt;console.log(2), 0)&lt;br&gt;
const promise1 = new Promise((resolve, reject) =&amp;gt; {&lt;br&gt;
  console.log(3)&lt;br&gt;
  resolve(4)&lt;br&gt;
})&lt;/p&gt;

&lt;p&gt;promise1.then(res =&amp;gt; {&lt;br&gt;
  console.log(res)&lt;br&gt;
})&lt;br&gt;
console.log(5)&lt;/p&gt;

&lt;p&gt;// 1, 3, 5, 4, 2&lt;br&gt;
Link: Promises&lt;/p&gt;

&lt;p&gt;Data Structures&lt;br&gt;
This part is a little hard for beginner-level developers. Just try to understand the concepts. You will comprehend their importance after coming across some real-life examples.&lt;/p&gt;

&lt;p&gt;If these seem difficult to you, feel free to jump right into the next section — React JS. But remember to return to this phase afterwards.&lt;/p&gt;

&lt;p&gt;Should learn: Array, Linked List, Stack, Queue, Hash Table, Tree.&lt;br&gt;
Tutorials: 8 Common Data Structures, Data Structures you must know, Hackerrank Data Structures, Basic Data Structures, FreeCodeCamp Basic Algorithm Scripting&lt;br&gt;
Algorithms&lt;br&gt;
Focus on easy Array and String algorithms more. Hackerrank algorithms. The more you solve, the better you’ll get.&lt;/p&gt;

&lt;p&gt;You can find solutions and tutorials for the specific algorithm on Youtube by searching its name.&lt;/p&gt;

&lt;p&gt;React&lt;br&gt;
Install NodeJS to your computer.&lt;/p&gt;

&lt;p&gt;Understand how React works, write an app (I will give a hint about that at the end) and prepare for the interviews.&lt;/p&gt;

&lt;p&gt;Learn Modern React&lt;br&gt;
Kent C. Dodds's introduction&lt;br&gt;
React in 30 mins&lt;br&gt;
Get certified:&lt;/p&gt;

&lt;p&gt;React-101&lt;br&gt;
Meta Front-End Developer Professional Certificate&lt;br&gt;
React Basics Certificate&lt;br&gt;
Important concepts: States and Props, hooks vs LifeCycle Methods, prop drilling, Higher-order Components (HOCs), Virtual DOM (reconciliation), pure components, conditional rendering, JSX, Webpack.&lt;/p&gt;

&lt;p&gt;State management: Redux, MobX or Recoil&lt;br&gt;
React uses Context API to share the state between components. But it is the default built-in functionality and not that popular due to its lack of scalability. I have written an article about that.&lt;/p&gt;

&lt;p&gt;Redux is more popular and a bit hard to use. It is a library inspired by Flux architecture. I prefer Recoil. Choose one and learn its depths.&lt;/p&gt;

&lt;p&gt;Those tools also need asynchronous functions to make server requests and share them between components. I have used Redux with Saga, but now I use Recoil with React-Query most of the time.&lt;/p&gt;

&lt;p&gt;You should learn Redux to get more chances to pass the interview.&lt;/p&gt;

&lt;p&gt;Popularity graph&lt;/p&gt;

&lt;p&gt;Tutorials:&lt;/p&gt;

&lt;p&gt;Redux: Redux in 100 seconds, Redux from scratch&lt;/p&gt;

&lt;p&gt;Recoil: In 10 mins, in 2 minutes.&lt;/p&gt;

&lt;p&gt;MobX: Search Youtube.&lt;/p&gt;

&lt;p&gt;Testing&lt;br&gt;
Wetest our components and functions in case they might break with changes done in the future. Components are tested directly by unit tests and their communication by integration tests.&lt;/p&gt;

&lt;p&gt;Tutorial: React testing library&lt;/p&gt;

&lt;p&gt;UI&lt;br&gt;
Choose one: Tailwind, Styled Components or MaterialUI are the most popular ones. I prefer Tailwind.&lt;/p&gt;

&lt;p&gt;If you have already learned Bootstrap, you’ll easily adapt to Tailwind.&lt;/p&gt;

&lt;p&gt;Backend mock.&lt;br&gt;
Choose one: JSON Placeholder and Connect API Mocker are for creating mock (fake) API endpoints.&lt;/p&gt;

&lt;p&gt;Firebase and NodeJS are also useful if you want real data or a WebSocket connection.&lt;/p&gt;

&lt;p&gt;Typescript&lt;br&gt;
Asa junior dev, you won’t need to learn the depths. If you gain some general knowledge, you’ll have more chances to land the first development job.&lt;/p&gt;

&lt;p&gt;Tutorials: General knowledge, React Typescript&lt;/p&gt;

&lt;p&gt;Write an app&lt;br&gt;
This part is the most important one. You can choose to create a blog, to-do, personal website or any of your idea. It should be small and easy to write.&lt;/p&gt;

&lt;p&gt;Tech stack I recommend using (from easier to more advanced):&lt;br&gt;
React Query, Recoil, normal CSS, Axios, React Hook Form, JSON placeholder.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;React Router, Redux, Redux-Saga, SASS or Tailwind, Connect API Mocker.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Typescript, React Query, Styled Components or MaterialUI, Firebase.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Interview Preparation&lt;br&gt;
Prepare as much as you can. As I stated before, the more you learn, the more chance you’ll have to pass the exam.&lt;/p&gt;

&lt;p&gt;It is a general practice in front-end interviews to ask for pure Javascript features and easy algorithms.&lt;/p&gt;

&lt;p&gt;So try to focus on Javascript.&lt;/p&gt;

&lt;p&gt;Frontend Interview Handbook (Trivia)&lt;br&gt;
ReactJS interview questions&lt;br&gt;
Important JS concepts&lt;br&gt;
Javascript.info&lt;br&gt;
Javascript Visualizer&lt;br&gt;
Practice:&lt;br&gt;
Dev.to preparation Materials&lt;br&gt;
Hooks cheatsheet&lt;br&gt;
Also, prepare an introduction about yourself before the interview.&lt;/p&gt;

&lt;p&gt;Use Google a lot&lt;br&gt;
You can find almost everything needed for the interviews. Enhance your searching abilities.&lt;/p&gt;

&lt;p&gt;“How … works”, “How to prepare for …”.&lt;br&gt;
Tips, Cheatsheet, tricks: “git cheatsheet”, “Interview tips for JS”, “CV tricks” etc.&lt;br&gt;
“Top [react, javascript, HTML etc.] interview questions”.&lt;br&gt;
“What is …”.&lt;br&gt;
“Best practice for …”.&lt;br&gt;
If there is any bug or error you can’t solve on your own (Which is a great possibility), copy+paste it on Google and find the best answer on StackOverflow&lt;/p&gt;

&lt;p&gt;Create a competitive CV&lt;br&gt;
The first impression is the most important part of an interview. There will be thousands of applications for a junior role, so become more visible by following the best practices.&lt;/p&gt;

&lt;p&gt;In this link, there are sample resumes of employees that got hired by top companies.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Asa junior developer, the hardest part of the business is finding the first job. What can be done?&lt;/p&gt;

&lt;p&gt;Participate in freelance projects.&lt;br&gt;
Apply for intern positions.&lt;br&gt;
Enhance your professional connections.&lt;br&gt;
Open a Linkedin account.&lt;br&gt;
Prepare for the interviews.&lt;br&gt;
Create a cover letter.&lt;br&gt;
Support open-source projects.&lt;br&gt;
Get certificates.&lt;br&gt;
Read Medium articles daily&lt;br&gt;
Search Google a lot for tips. “How to land the first dev job”, “How to prepare for the interview”, “How to find frontend intern job” etc.&lt;br&gt;
I wish this article will be helpful.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>9 Tips for Writing Clean, Fast, And Maintainable React Code</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Fri, 28 Jul 2023 15:45:47 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/9-tips-for-writing-clean-fast-and-maintainable-react-code-59ng</link>
      <guid>https://dev.to/certifieddev19960101/9-tips-for-writing-clean-fast-and-maintainable-react-code-59ng</guid>
      <description>&lt;p&gt;React Components In Code Editor&lt;br&gt;
Make Your Work Clean, Fast, and Easy to-Maintain.&lt;br&gt;
I know — this is every programmer’s goal (or at least I hope it is).&lt;/p&gt;

&lt;p&gt;And, in my opinion, this skill separates a good programmer from a superb programmer.&lt;/p&gt;

&lt;p&gt;The best part is that it is never truly finished because there is always something new to learn and improve on.&lt;/p&gt;

&lt;p&gt;Following these tips can make things simpler not just for you, but also for your teammates.&lt;/p&gt;

&lt;p&gt;I’ve seen development teams develop a style guide in which they set key principles for how they write code.&lt;/p&gt;

&lt;p&gt;If you ask me, it’s a brilliant concept.&lt;/p&gt;

&lt;p&gt;Among them were:&lt;/p&gt;

&lt;p&gt;make advantage of functional components (like arrow functions)&lt;br&gt;
Inline styles should not be used.&lt;br&gt;
keep a good import structure (third-party imports first, next internal imports)&lt;br&gt;
Before committing your code, format it.&lt;br&gt;
And the like.&lt;/p&gt;

&lt;p&gt;Of course, you could go into considerable detail about it. This is decided by your team.&lt;/p&gt;

&lt;p&gt;Personally, I hate detailed style guides because I believe that as a skilled developer, you should have some degree of freedom and should not be overly limited.&lt;/p&gt;

&lt;p&gt;However, a style guide in general is a smart way to outline and promote the best tips while also verifying that your team is on the same page in some key areas.&lt;/p&gt;

&lt;p&gt;This, I find, greatly improves teamwork and productivity.&lt;/p&gt;

&lt;p&gt;Let’s look at what those best tips are for creating clean, highly functional, and maintainable components.&lt;/p&gt;

&lt;p&gt;Make yourself comfortable, get something to take notes with, and have fun!&lt;/p&gt;

&lt;p&gt;Create an effective folder structure.&lt;br&gt;
Effective Folder Structure In Code Editor&lt;br&gt;
Always Try To Maintain Folder Structure&lt;br&gt;
Maintainability and flexibility need you to structure your files and directories within your React application.&lt;/p&gt;

&lt;p&gt;A proper folder structure is based on the complexity of your app and the size of your team.&lt;/p&gt;

&lt;p&gt;As a result, there is no ultimate solution.&lt;/p&gt;

&lt;p&gt;Especially since this is a widely controversial point that also depends on personal tastes.&lt;/p&gt;

&lt;p&gt;However, some best tips for different software sizes have been developed over time.&lt;/p&gt;

&lt;p&gt;This outstanding blog post covers 5 different app sizes and offers helpful suggestions for organizing your files and folders.&lt;/p&gt;

&lt;p&gt;Keeping this in mind as you prepare or start your app might have a major impact in the long run.&lt;/p&gt;

&lt;p&gt;Really shouldn’t, but do your best to keep a clear structure that is fit for your current application and team size.&lt;/p&gt;

&lt;p&gt;Maintain a structured import order&lt;br&gt;
React Illustration&lt;br&gt;
Put Import Order in Manner&lt;br&gt;
If you’ve worked with React before, you’ve probably seen files that are bloated with a lot of import statements.&lt;/p&gt;

&lt;p&gt;They could also be mixed up with third-party package external imports and internal imports such as other components, util functions, styles, and many more.&lt;/p&gt;

&lt;p&gt;Example from the Real World (cut):&lt;/p&gt;

&lt;p&gt;Standard Version Of Import Order&lt;br&gt;
This is an example of a normal import order.&lt;br&gt;
You’re undoubtedly aware of what’s happening here.&lt;/p&gt;

&lt;p&gt;It’s difficult to distinguish the difference between third-party and local (internal) imports.&lt;/p&gt;

&lt;p&gt;They are not organized and seem to be distributed.&lt;/p&gt;

&lt;p&gt;Improved Version:&lt;/p&gt;

&lt;p&gt;Improved Version Of Import Order&lt;br&gt;
This is an example of an improved version of the import order.&lt;br&gt;
The structure is smoother, and it is much simpler to distinguish between external and internal imports.&lt;/p&gt;

&lt;p&gt;Of course, you can improve it by using more named imports (if that’s possible! :)).&lt;/p&gt;

&lt;p&gt;This allows you to import all of the components from material-ui on a single line.&lt;/p&gt;

&lt;p&gt;Other developers, I’ve seen, like to break the import structure into three sections:&lt;/p&gt;

&lt;p&gt;Internal → External (third-party node modules) → Built-in (like react).&lt;/p&gt;

&lt;p&gt;You can do it yourself every time or hire a linter.&lt;/p&gt;

&lt;p&gt;Here’s an excellent post on tweaking your linter for your React project to guarantee proper import structure.&lt;/p&gt;

&lt;p&gt;Explore higher-level component patterns.&lt;br&gt;
Component Pattern Including Three Components&lt;br&gt;
An Effective Component Pattern&lt;br&gt;
Learning new component patterns as you gain experience with React is important to avoiding unmaintainable and unscalable mess code.&lt;/p&gt;

&lt;p&gt;But that’s not all.&lt;/p&gt;

&lt;p&gt;Understanding the various patterns is an excellent starting point.&lt;/p&gt;

&lt;p&gt;But the most important aspect is that you understand when to use which pattern for which situation.&lt;/p&gt;

&lt;p&gt;Every pattern has a specific purpose.&lt;/p&gt;

&lt;p&gt;For example, the compound component pattern avoids needless prop-drilling of many component levels.&lt;/p&gt;

&lt;p&gt;So, the next time you pass props via five component levels to better than theirs the component that is interested in the props, you start organizing the components differently.&lt;/p&gt;

&lt;p&gt;I’ll make a little comment about props drilling because I’ve had many discussions about it in the past.&lt;/p&gt;

&lt;p&gt;There are many varying opinions on whether it is good or bad.&lt;/p&gt;

&lt;p&gt;If I start passing props via more than two component levels, I try to think of a better way/pattern.&lt;/p&gt;

&lt;p&gt;The truth increases your development efficiency and makes the components you design more robust and flexible.&lt;/p&gt;

&lt;p&gt;Having such patterns in your toolset separates you from other React developers.&lt;/p&gt;

&lt;p&gt;I strongly advise you to do your research, but this Udemy course was quite useful to me.&lt;/p&gt;

&lt;p&gt;Use a linter and follow its guides.&lt;br&gt;
Linter Features in Code Editor&lt;br&gt;
How Linter Helps You In Code Editor&lt;br&gt;
A linter can help you with more than just maintaining your dependencies in a unique import order.&lt;/p&gt;

&lt;p&gt;It usually helps you create better code.&lt;/p&gt;

&lt;p&gt;ESLint is fully set when you use create-react-app, but you can also create it completely on your own or extend the rules of a which were before the rule.&lt;/p&gt;

&lt;p&gt;A linter examines the JavaScript code you’re writing and warns you of mistakes that you’d more likely see if you run the code.&lt;/p&gt;

&lt;p&gt;It took some time for me to understand the use of a linter, but now I can’t imagine working without one.&lt;/p&gt;

&lt;p&gt;It’s one thing to have the linter, but it’s entirely different to follow its guidelines.&lt;/p&gt;

&lt;p&gt;Of course, you can turn it off. Either for a certain line of code or the whole file.&lt;/p&gt;

&lt;p&gt;There could be situations when this makes sense, but in my experience, they are extremely rare.&lt;/p&gt;

&lt;p&gt;Another major benefit is the ability to adjust style checkers. This is very useful for teams.&lt;/p&gt;

&lt;p&gt;You can easily combine ESLint with something like JSPrettify if you’ve agreed on some guidelines for how you write your code and how it should be structured.&lt;/p&gt;

&lt;p&gt;Put your code to the test.&lt;br&gt;
An Laptop Testing Code&lt;br&gt;
Test Your Code In Every Routine Day&lt;br&gt;
I understand that testing is probably not your favorite activity as a developer.&lt;/p&gt;

&lt;p&gt;That was how I used to be.&lt;/p&gt;

&lt;p&gt;At first, it seemed to be a useless and painful activity.&lt;/p&gt;

&lt;p&gt;This might be true in the short run. But, in the long run — especially as the application expands — it is important.&lt;/p&gt;

&lt;p&gt;Testing has become a routine for me that guarantees I’m performing my job properly and delivering higher-quality code.&lt;/p&gt;

&lt;p&gt;There is nothing wrong with manual testing by humans, and it should not be avoided entirely.&lt;/p&gt;

&lt;p&gt;However, say you are integrating a new feature and want to verify that nothing is broken.&lt;/p&gt;

&lt;p&gt;This can be a time-consuming and error-prone activity.&lt;/p&gt;

&lt;p&gt;You’re already thinking about how to structure your code to pass this test while you’re developing tests.&lt;/p&gt;

&lt;p&gt;This is usually useful for me since I can predict future problems and keep a look out for them.&lt;/p&gt;

&lt;p&gt;You’re not going right into creating code (which I wouldn’t recommend), but you’re thinking about the ultimate goal first.&lt;/p&gt;

&lt;p&gt;As an example, “What should that specific component do? What important edge cases could arise that I must test? Can I clean the component such that it just serves one purpose? …”&lt;/p&gt;

&lt;p&gt;Having a vision for the code you’re going to create can also help you stay focused on serving that vision.&lt;/p&gt;

&lt;p&gt;Tests can also act as documentation in the sense that they can help a new developer who is new to the codebase understand the various elements of the product and how they are supposed to work.&lt;/p&gt;

&lt;p&gt;So, don’t try to stay away from testing because it seems to be more work.&lt;/p&gt;

&lt;p&gt;When configured correctly, it can save you time and effort in the future.&lt;/p&gt;

&lt;p&gt;Explore the “Testing” section in the React Docs, watch a few tutorials on testing in React, and simply begin writing your first small TDD application or adding tests to an app you’re currently working on.&lt;/p&gt;

&lt;p&gt;Typescript should be used (or use default props &amp;amp; proptypes)&lt;br&gt;
TypeScript Banner&lt;br&gt;
You should start using typescript or, at the minimum, the default props and prop types.&lt;br&gt;
I remember my first React project as a software developer when our team was given a project that had previously been created in its entirety by another company.&lt;/p&gt;

&lt;p&gt;Then we had to build the client’s project on top of it, and Typescript was already built in.&lt;/p&gt;

&lt;p&gt;My teammates and I had no prior experience with TypeScript because we all came from a vanilla JavaScript background.&lt;/p&gt;

&lt;p&gt;After a few weeks of working on that project, we decided that TypeScript was not an advantage, but rather a burden to our workflow.&lt;/p&gt;

&lt;p&gt;We were also not getting the full benefits because we defined everything with type any to suppress Typescript warnings.&lt;/p&gt;

&lt;p&gt;As a result, we decided to remove TypeScript from the project and stick to our tried-and-true vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;This worked smoothly at first, but as our project got more complicated, more errors appeared.&lt;/p&gt;

&lt;p&gt;So we doubted our choice to quit TypeScript fully.&lt;/p&gt;

&lt;p&gt;But such situations do happen and provide us with important experiences for the future.&lt;/p&gt;

&lt;p&gt;This scenario inspired me to review TypeScript, which I studied in my spare time.&lt;/p&gt;

&lt;p&gt;I can’t imagine my life without it now that I’ve built some side projects using it.&lt;/p&gt;

&lt;p&gt;TypeScript has many advantages, like static type checking, better code completion in your IDE (IntelliSense), a better developer experience, and catching type errors as you write code — only to mention a few.&lt;/p&gt;

&lt;p&gt;On the other side, it might offer some difficulties, because if you don’t come from a background with tightly typed languages (such as Java or C#), it could be difficult to understand at first.&lt;/p&gt;

&lt;p&gt;But I can tell that learning and applying it is well worth the effort.&lt;/p&gt;

&lt;p&gt;Here’s a good article that will provide you with an overview of the advantages and disadvantages of using Typescript in React apps.&lt;/p&gt;

&lt;p&gt;And here’s a guide on writing TypeScript code for your React apps.&lt;/p&gt;

&lt;p&gt;There may be reasons why you do not want to use TypeScript in your React project.&lt;/p&gt;

&lt;p&gt;Make use of lazy loading &amp;amp; code splitting.&lt;br&gt;
An Code Editor&lt;br&gt;
Lazy Loading &amp;amp; Code Splitting is very useful in the workflow.&lt;br&gt;
If you’ve spent any time in the JavaScript and React world, you’ve most likely come across the concept of bundling.&lt;/p&gt;

&lt;p&gt;For those of you hearing this word for the first time, here’s what the official React documentation says:&lt;/p&gt;

&lt;p&gt;Most React projects will use tools like Webpack, Rollup, or Browserify to “bundle” their files.&lt;/p&gt;

&lt;p&gt;Bundling is the process of following imported files and joining them into a single file: a “bundle”.&lt;/p&gt;

&lt;p&gt;This bundle can then be linked to a webpage to load the full app at once.&lt;/p&gt;

&lt;p&gt;Basically, this is a fantastic strategy, but when your app expands, it will cause a problem.&lt;/p&gt;

&lt;p&gt;Your bundle starts to grow as well.&lt;/p&gt;

&lt;p&gt;Especially when using large third-party libraries such as three.js.&lt;/p&gt;

&lt;p&gt;The disadvantage is that this bundle must always be loaded fully, even if the user just requires a section of the code.&lt;/p&gt;

&lt;p&gt;This produces performance issues since your app can take an extra long time to load.&lt;/p&gt;

&lt;p&gt;To avoid this, use a method known as code splitting, which separates your bundle into the pieces of code your user need.&lt;/p&gt;

&lt;p&gt;The most popular bundlers, such as Webpack, Rollup, and Browserify, enable this.&lt;/p&gt;

&lt;p&gt;The fact that you can build different bundles and load them dynamically is a huge advantage.&lt;/p&gt;

&lt;p&gt;To clarify, say you’re heading to the grocery shop and only want bananas, apples, and bread.&lt;/p&gt;

&lt;p&gt;In that case, you are not buying the entire shop and then selecting your bananas, apples, and bread from that too.&lt;/p&gt;

&lt;p&gt;You’re only interested in a slice of the range. So, why would you buy everything?&lt;/p&gt;

&lt;p&gt;It would take much longer and would be much more expensive.&lt;/p&gt;

&lt;p&gt;I believe it is important to be aware of the potential issues which may arise as your app expands, and that there are ways available to address such concerns.&lt;/p&gt;

&lt;p&gt;Check out the React documentation for more information.&lt;/p&gt;

&lt;p&gt;Organize reusable logic into custom hooks&lt;br&gt;
React Hook&lt;br&gt;
Create your custom hooks&lt;br&gt;
According to the React documentation,&lt;/p&gt;

&lt;p&gt;Hooks let us reuse stateful code without having to change our forming.&lt;/p&gt;

&lt;p&gt;Essentially, they are a superior answer to the methods that were previously used in combination with class components.&lt;/p&gt;

&lt;p&gt;You might remember using Higher Order Components or render properties if you’ve been coding for a while.&lt;/p&gt;

&lt;p&gt;When you need to reuse the same stateful logic that is already in use in another functional component, it’s a wonderful opportunity to develop a custom hook.&lt;/p&gt;

&lt;p&gt;You wrap the logic within it and only need to call the hook as a function within your components.&lt;/p&gt;

&lt;p&gt;Let’s look at a quick example where we need to change our UI based on screen size and want to keep track of the current window size while manually resizing the browser window.&lt;/p&gt;

&lt;p&gt;const ScreenDimensions = () =&amp;gt; {&lt;br&gt;
  const [windowSize, setWindowSize] = useState({&lt;br&gt;
    width: undefined,&lt;br&gt;
    height: undefined,&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    function handleResize() {&lt;br&gt;
      setWindowSize({&lt;br&gt;
        width: window.innerWidth,&lt;br&gt;
        height: window.innerHeight,&lt;br&gt;
      });&lt;br&gt;
    }&lt;br&gt;
    window.addEventListener('resize', handleResize);&lt;br&gt;
    handleResize();&lt;br&gt;
    return () =&amp;gt; window.removeEventListener('resize', handleResize);&lt;br&gt;
  }, []);&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
   &amp;lt;&amp;gt;&lt;br&gt;
     &lt;/p&gt;
&lt;p&gt;Current screen width: {windowSize.width}&lt;/p&gt;
&lt;br&gt;
        &lt;p&gt;Current screen height: {windowSize.height}&lt;/p&gt;
&lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
As you can see, the solution is pretty straightforward and there’s nothing wrong with defining it like this.

&lt;p&gt;Now comes the tricky part.&lt;/p&gt;

&lt;p&gt;Imagine we’d like to use the exact logic in another component, where we’ll render a different UI (one for smartphones and one for desktops) based on the current screen size.&lt;/p&gt;

&lt;p&gt;Of course, we could just copy the logic, paste it in and we’re done.&lt;/p&gt;

&lt;p&gt;But this is not a good tip, as you might know from the DRY principle.&lt;/p&gt;

&lt;p&gt;If we’d like to adjust our logic, we have to do it in both components.&lt;/p&gt;

&lt;p&gt;And when we paste our logic into even more components, it becomes less maintainable and more error-prone.&lt;/p&gt;

&lt;p&gt;So, what would you normally do in a vanilla JavaScript project?&lt;/p&gt;

&lt;p&gt;You’d most likely define a function that encapsulates the logic and can be used in many different places.&lt;/p&gt;

&lt;p&gt;That’s exactly what we’ll achieve with hooks.&lt;/p&gt;

&lt;p&gt;They are nothing more than JavaScript functions but with some React specialties because they’re using React hooks.&lt;/p&gt;

&lt;p&gt;So, in a typical JavaScript project, what would you do?&lt;/p&gt;

&lt;p&gt;Most likely, you’d build a function that encapsulates the logic and can be used in a variety of ways.&lt;/p&gt;

&lt;p&gt;That is exactly what we will do using hooks.&lt;/p&gt;

&lt;p&gt;They are nothing more than JavaScript functions with some React brilliance thanks to the use of React hooks.&lt;/p&gt;

&lt;p&gt;Let’s have a look at our unique hook:&lt;/p&gt;

&lt;p&gt;const useWindowSize = () =&amp;gt; {&lt;br&gt;
  const [windowSize, setWindowSize] = useState({&lt;br&gt;
    width: undefined,&lt;br&gt;
    height: undefined,&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;useEffect(() =&amp;gt; {&lt;br&gt;
    function handleResize() {&lt;br&gt;
      setWindowSize({&lt;br&gt;
        width: window.innerWidth,&lt;br&gt;
        height: window.innerHeight,&lt;br&gt;
      });&lt;br&gt;
    }&lt;br&gt;
    window.addEventListener('resize', handleResize);&lt;br&gt;
    handleResize();&lt;br&gt;
    return () =&amp;gt; window.removeEventListener('resize', handleResize);&lt;br&gt;
  }, []);&lt;/p&gt;

&lt;p&gt;return windowSize;&lt;br&gt;
}&lt;br&gt;
Let’s just name it that inside our ScreenDimensions component:&lt;/p&gt;

&lt;p&gt;const ScreenDimensions = () =&amp;gt; {&lt;br&gt;
  const windowSize = useWindowSize()&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
   &amp;lt;&amp;gt;&lt;br&gt;
     &lt;/p&gt;
&lt;p&gt;Current screen width: {windowSize.width}&lt;/p&gt;
&lt;br&gt;
        &lt;p&gt;Current screen height: {windowSize.height}&lt;/p&gt;
&lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
This lets us simply call the custom hook from any other component and save the return value (the current window size) in a variable that we can use inside the component.

&lt;p&gt;const ResponsiveView = () =&amp;gt; {&lt;br&gt;
  const windowSize = useWindowSize()&lt;/p&gt;

&lt;p&gt;return (&lt;br&gt;
   &amp;lt;&amp;gt;&lt;br&gt;
     {windowSize.width &amp;lt;= 960 ? (&lt;br&gt;
          &lt;br&gt;
        ) : (&lt;br&gt;
           &lt;br&gt;
        )}&lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
Handle errors correctly.&lt;br&gt;
Errors on desk in front of man&lt;br&gt;
Try to handle errors as best you can (It Time Saving)&lt;br&gt;
Many developers ignore and underestimate the importance of error handling.&lt;/p&gt;

&lt;p&gt;This seems to be a mistake from the start, as with many other best tips.&lt;/p&gt;

&lt;p&gt;You want the code to work and don’t want to “waste” time thinking about errors.&lt;/p&gt;

&lt;p&gt;However, as you gain experience and see situations where better error handling could have saved you a lot of energy (and valuable time), you know that having solid error handling inside your app is important in the long run.&lt;/p&gt;

&lt;p&gt;Especially when the application is in service.&lt;/p&gt;

&lt;p&gt;But what does error handling mean in the React world? There are a few parts that have a role.&lt;/p&gt;

&lt;p&gt;One is to catch errors, another is to handle the UI properly, and the last is to properly report them.&lt;/p&gt;

&lt;p&gt;Final words&lt;br&gt;
That was a lot of fun, wasn’t it?&lt;/p&gt;

&lt;p&gt;I tried my hardest to get everything out of my thoughts that had been collected over time.&lt;/p&gt;

&lt;p&gt;My goal in writing this post is to share my experience with you to help you avoid some challenging times during your React learning and progress.&lt;/p&gt;

&lt;p&gt;Of course, there may be great tips that you think are more important than I have missed. That’s awesome.&lt;/p&gt;

&lt;p&gt;I’d love to hear anything you think should be added to this post.&lt;/p&gt;

&lt;p&gt;Remember that it is always about changing what is useful to you.&lt;/p&gt;

&lt;p&gt;So, don’t take things for granted, and think about what can be useful in your situation.&lt;/p&gt;

&lt;p&gt;Then just add it to your list of best tips.&lt;/p&gt;

&lt;p&gt;You can also follow me on Medium.&lt;/p&gt;

&lt;p&gt;I’m always ready to help you and welcome any comments you can offer me.&lt;/p&gt;

&lt;p&gt;So definitely don’t hesitate to speak with me.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>“Top Frontend Interview Questions : (Part 1) — Boost Your Knowledge and Ace Your Next Job Interview!”</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Thu, 27 Jul 2023 09:07:26 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/top-frontend-interview-questions-part-1-boost-your-knowledge-and-ace-your-next-job-interview-3b39</link>
      <guid>https://dev.to/certifieddev19960101/top-frontend-interview-questions-part-1-boost-your-knowledge-and-ace-your-next-job-interview-3b39</guid>
      <description>&lt;p&gt;Hey there! Are you excited about your upcoming job interview in the field of frontend development? and so am I! And I’ve got some exciting news for you — I’m also preparing for interviews, and I’ll be sharing all the interview questions I learn each day with you! This way, we can both learn together and be better prepared for our interviews.&lt;/p&gt;

&lt;p&gt;Now, I know that preparing for interviews can be a bit daunting, but don’t worry — we’ll make it easy. We’ll break down each question into simple terms that anyone can understand, and we’ll have a blast doing it. So what are we waiting for, let’s get started!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What are the Semantic elements in HTML :
Semantic elements in HTML are simply tags that have meaningful names which tells about what type of content it stores. For example header, footer, table, nav, … etc. HTML5 introduces many semantic elements which make the code easier to write and understand for the developer as well as instructs the browser on how to treat them.&lt;/li&gt;
&lt;li&gt;Difference between position relative and position absolute :
Relative Position : For relative-positioned elements, the origin is their original position in the normal flow of the document. If you apply top: 10px to it, it will move 10px down from it's original position, not affecting the normal flow of the document.
Absolute Position : However, for absolute-positioned elements, the origin is it’s first parent which has a relative,absolute,or fixed position. If you apply top: 10px to it, it will move 10px down from it's parent's top.
So it goes out of the normal document flow, affecting the other elements' location.
Fixed Position : position: fixed; property applied to an element will cause it to always stay in the same place even if the page is scrolled. To position the element we use top, right, bottom, left properties.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;relative vs absolute positioning&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is flexbox :
CSS Flexbox is a one dimentional CSS layout module that is used to arrange and organize items on web pages in one direction, i.e., horizontally and vertically (row or column) and control how they stretch, shrink, or wrap. The Flexible Box Layout Module, makes it easier to design flexible responsive layout structure without using float or positioning.\&lt;/li&gt;
&lt;li&gt;What is Box-model in CSS :
In CSS, the term “box model” is used when talking about design and layout. The CSS box model is essentially a box that wraps around every HTML element. It consists of : margins, borders, padding, and the actual content. The content is what’s inside the box, like text or an image. The padding is the space between the content and the border. The border is the line that surrounds the box, and the margin is the space between the border and other elements on the page.
CSS Box Model
CSS Box Model&lt;/li&gt;
&lt;li&gt;What is Event Loop :
The Event Loop is a key concept in JavaScript that helps with handling asynchronous code. In simple terms, it’s a loop that constantly checks if any code needs to be executed, and if so, it executes that code.
Here’s how it works: when you run a piece of code that takes some time to complete, like fetching data from a server or waiting for a user’s input, JavaScript doesn’t just stop and wait for that code to finish. Instead, it moves on to the next line of code, and checks back later to see if the previous code has finished executing.
This checking process is done by the Event Loop. It constantly checks the queue of tasks that need to be executed, and when it finds one, it puts it in the Call Stack, which is a data structure that keeps track of all the code being executed. The Call Stack then executes that code, and once it’s done, it removes it from the stack and moves on to the next task.
In summary, the Event Loop is what allows JavaScript to handle asynchronous code by constantly checking for tasks that need to be executed, and executing them in the right order.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, within the event loop, there are two types of tasks — microtasks and macrotasks. Microtasks are small, high-priority tasks that need to be executed immediately. Examples of microtasks include promise callbacks, mutation observers, and queueMicrotask(). While macrotasks are larger, lower-priority tasks that can be executed later. These tasks include things like setTimeout(), setInterval(), and requestAnimationFrame(). Understanding the difference between these two types of tasks is important for writing efficient, performant JavaScript code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is DOM :
The Document Object Model, or DOM for short, is like a tree structure that represents the content of a webpage in code. This structure includes all the elements, like headings and paragraphs, and allows developers to access and modify them using JavaScript. The DOM helps to create dynamic and interactive webpages without having to reload the entire page. Think of it as a way for developers to talk to a webpage and make changes to it in real-time.&lt;/li&gt;
&lt;li&gt;What is Hoisting in JavaScript :
Hoisting is a concept which enables us to extract values of variables and functions even before initialising/assigning value without getting error and this is happening due to the 1st phase (memory creation phase) of the Execution Context.
The execution context gets created in two phase, so even before code execution, memory is created so in case of variable, it will be initialized as undefined while in case of function the whole function code is placed in the memory.&lt;/li&gt;
&lt;li&gt;What is Closures :
Function bundled along with it’s lexical scope is closure.
JavaScript has a lexical scope environment. If a function needs to access a variable, it first goes to its local memory. When it does not find it there, it goes to the memory of its lexical parent. See Below code, Over here function y along with its lexical scope i.e. (function x) would be called a closure.
A closure is a function that has access to its outer function scope even after the function has returned. Meaning, A closure can remember and access variables and arguments reference of its outer function even after the function has returned.
See Below code, Over here function y along with its lexical scope i.e. (function x) would be called a closure.
function x() {
var a = 7;
function y() {
console.log(a);
}
return y;
}
var z = x();
console.log(z); // value of z is entire code of function y.
In above code, When y is returned, not only is the function returned but the entire closure (fun y + its lexical scope) is returned and put inside z. So when z is used somewhere else in program, it still remembers var a inside x().&lt;/li&gt;
&lt;li&gt;What is Callback Hell :
Callback Hell is a situation that can occur in JavaScript programming when there are too many nested callbacks. It can happen when you have to execute multiple asynchronous functions one after another and each function depends on the result of the previous function.
To avoid Callback Hell, we can use promises, async/await, or other techniques to make the code more readable and manageable.&lt;/li&gt;
&lt;li&gt;Difference between map, filter and reduce :
Map, filter &amp;amp; reducer are Higher Order Functions.
Map: The map function takes an array and creates a new array with each element transformed based on a function provided. For example, if you had an array of numbers, you could use map to create a new array with each number multiplied by 2.
Filter: The filter function takes an array and creates a new array with only the elements that pass a test based on a function provided. For example, if you had an array of numbers, you could use filter to create a new array with only the even numbers.
Reduce: The reduce function takes an array and returns a single value by performing a specified operation on each element of the array. For example, if you had an array of numbers, you could use reduce to find the sum of all the numbers in the array.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Roadmap for ReactJS Developers in 2023 | Zero to Hero</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Wed, 26 Jul 2023 17:18:29 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/roadmap-for-reactjs-developers-in-2023-zero-to-hero-nhb</link>
      <guid>https://dev.to/certifieddev19960101/roadmap-for-reactjs-developers-in-2023-zero-to-hero-nhb</guid>
      <description>&lt;p&gt;Here is a roadmap that will take you from zero to hero as a React developer in 2023, whether you’re just getting started or looking to advance your abilities:&lt;/p&gt;

&lt;p&gt;Learn the fundamentals of JavaScript&lt;/p&gt;

&lt;p&gt;As JavaScript is the foundation of React, having a firm grasp of its principles is crucial. Start by studying objects, loops, conditionals, functions, and variables.&lt;/p&gt;

&lt;p&gt;Learn the basics of HTML and CSS&lt;/p&gt;

&lt;p&gt;The foundational languages of web development are HTML and CSS. To design HTML elements, style them, and leverage CSS frameworks like Bootstrap or Material UI, you should understand how to do all of these things.&lt;/p&gt;

&lt;p&gt;Learn React basics&lt;/p&gt;

&lt;p&gt;Learn the fundamentals of React first, such as components, props, state, and JSX. Online courses, YouTube tutorials, or React documentation are good places to start.&lt;/p&gt;

&lt;p&gt;Top Marketplace For Buying Source Code, Pre-built Websites For Sale&lt;br&gt;
Codemarketi is a new platform available for buying source code. Get an industry-specific website, prebuilt for you! Get…&lt;br&gt;
&lt;a href="http://www.codemarketi.com"&gt;www.codemarketi.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dive deeper into React concepts&lt;/p&gt;

&lt;p&gt;Learn more about advanced React ideas like React Router, Redux, React Hooks, Context API, and Server-Side Rendering after you’ve mastered the fundamentals.&lt;/p&gt;

&lt;p&gt;Mastering React Hooks: How to Use Them Effectively in Your React Applications&lt;br&gt;
Developers can now use states and other React features in functional components thanks to React Hooks, a potent new…&lt;br&gt;
medium.com&lt;/p&gt;

&lt;p&gt;5 React Design Patterns You Should Know&lt;br&gt;
One of the most widely used front-end frameworks is React, and for good reason. Its component-based architecture…&lt;br&gt;
medium.com&lt;/p&gt;

&lt;p&gt;Practice building projects&lt;/p&gt;

&lt;p&gt;Building projects is the most effective method to learn React. A to-do list or a calculator are good places to start, and you can work your way up to more difficult projects like an online store or social network.&lt;/p&gt;

&lt;p&gt;Online Movie Streaming Website in React and Nodejs with Full Source Code&lt;br&gt;
React and Node.js are two powerful technologies used to build web applications. The React Node.js Movie App is a…&lt;br&gt;
medium.com&lt;/p&gt;

&lt;p&gt;Learn testing&lt;/p&gt;

&lt;p&gt;Software testing is a crucial component, and React offers a variety of testing methods and modules. With your React applications, learn how to create unit tests and integration tests.&lt;/p&gt;

&lt;p&gt;Learn about performance optimization&lt;/p&gt;

&lt;p&gt;Performance optimization becomes increasingly important as your applications expand. Learn about code splitting, lazy loading, and other methods that can enhance the efficiency of your application.&lt;/p&gt;

&lt;p&gt;Optimize Your Code Right Away with These 4 React Suggestions&lt;br&gt;
For creating user interfaces, React is a well-liked and often used JavaScript library. React has many wonderful…&lt;br&gt;
towardsdev.com&lt;/p&gt;

&lt;p&gt;Stay up-to-date&lt;/p&gt;

&lt;p&gt;React is always changing, so it’s important to keep up with the most recent developments and recommended techniques. Attend conferences, participate in online forums, read blogs, and keep up with the React documentation.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Future of Programming</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Mon, 24 Jul 2023 18:42:16 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/the-future-of-programming-3be2</link>
      <guid>https://dev.to/certifieddev19960101/the-future-of-programming-3be2</guid>
      <description>&lt;p&gt;Artificial intelligence (AI) has revolutionized various aspects of our lives, from board games to customer service. As AI continues to advance and integrate into different industries, there has been growing concern about its impact on programming and whether AI will eventually replace human programmers. In this article, we will explore the current state of AI in programming, debunk myths surrounding AI’s capabilities, and examine how AI is reshaping the role of programmers.&lt;/p&gt;

&lt;p&gt;The Rise of AI in Programming&lt;br&gt;
Over the years, AI has made significant strides in creative pursuits, such as drawing pictures and composing music. It has also become capable of completing complex tasks, raising questions about its potential to take over programming roles. AI programs like DeepCoder, developed by Microsoft and Cambridge University, can not only write code but also learn and adapt.&lt;/p&gt;

&lt;p&gt;However, it is important to differentiate between anxiety and reality. While the fear of AI replacing programmers is understandable, the capabilities of AI have often been exaggerated. AI is not a standalone solution that can replace human programmers entirely. It is merely a tool that can assist and enhance the programming process.&lt;/p&gt;

&lt;p&gt;AI as a Tool, Not a Replacement&lt;br&gt;
Just as calculators assist mathematicians but cannot replace their expertise, AI serves as a valuable tool for programmers. It can speed up processes, automate repetitive tasks, and provide code suggestions. For example, AI-powered tools like DeepCode act as a spell-checker for programmers, helping them write cleaner and more efficient code.&lt;/p&gt;

&lt;p&gt;However, AI lacks the ability to understand the business value of features or make intuitive decisions. It requires human programmers to provide input, direction, and ensure the code aligns with the desired outcomes. Programmers play a crucial role in training and fine-tuning AI systems, ensuring they deliver accurate and reliable results.&lt;/p&gt;

&lt;p&gt;The Symbiotic Relationship between Humans and AI&lt;br&gt;
Contrary to popular belief, AI is not seeking to replace programmers but rather redefine their workload. AI aims to alleviate programmers from tedious and repetitive tasks, allowing them to focus on more important and creative aspects of their work. By automating certain aspects of programming, AI can improve efficiency and productivity.&lt;/p&gt;

&lt;p&gt;Through integration and controlled use, AI and humans can form a symbiotic relationship in programming. AI can generate code snippets, suggest solutions, and streamline workflows, while programmers provide critical thinking, problem-solving skills, and domain expertise. This collaboration leads to a more efficient and effective programming process.&lt;/p&gt;

&lt;p&gt;AI’s Limitations and the Need for Human Expertise&lt;br&gt;
While AI has made remarkable progress, it still has limitations. AI-generated code may contain errors, such as unused variables or incorrect declarations. It lacks the ability to fully comprehend the context and business requirements of a project. Human programmers possess the knowledge and experience necessary to evaluate the quality and suitability of code.&lt;/p&gt;

&lt;p&gt;Moreover, AI systems require continuous training and a constant feed of data. Programmers play a crucial role in monitoring, fine-tuning, and handling decision-making processes for AI systems. They ensure that AI remains aligned with the project goals and business objectives.&lt;/p&gt;

&lt;p&gt;The Impact of AI on Programming Workflows&lt;br&gt;
AI is already transforming programming workflows by introducing generative AI coding tools. These tools leverage natural language processing and existing code to suggest solutions, generate new ideas, and break down complex problems into manageable tasks. They offer developers a new level of creativity and productivity, enabling them to achieve more in less time.&lt;/p&gt;

&lt;p&gt;With the help of AI, developers can focus on inventing innovative products, making strategic decisions, and refining their programming skills. AI-assisted engineering workflows are becoming more prevalent, allowing developers to harness the power of AI while retaining control over the final outcome.&lt;/p&gt;

&lt;p&gt;The Changing Landscape of Software Development&lt;br&gt;
The advent of generative AI coding tools and AI-assisted workflows is reshaping the landscape of software development. Developers can now rely on AI to handle repetitive and mundane tasks, freeing up their time and mental energy for more critical aspects of their work. This shift allows developers to become more efficient and productive, leading to better software outcomes.&lt;/p&gt;

&lt;p&gt;AI’s influence extends beyond individual developers. Companies like Nvidia have leveraged AI to develop advanced chips and computing systems, powering artificial intelligence applications like ChatGPT and enhancing search engine capabilities. AI has also found applications in digital advertising, content generation, and various other industries.&lt;/p&gt;

&lt;p&gt;Embracing the AI-Enabled Future&lt;br&gt;
As AI continues to advance, it is crucial for programmers to embrace this AI-enabled future rather than fear it. By understanding the limitations and capabilities of AI, programmers can leverage its power to their advantage. Collaborating with AI can enhance their skills, boost productivity, and drive innovation in the field of programming.&lt;/p&gt;

&lt;p&gt;While AI may automate certain aspects of programming, it cannot replace the human touch. The unique insights, problem-solving abilities, and creativity that programmers bring to the table are irreplaceable. By working alongside AI, programmers can unlock new possibilities and shape the future of programming.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Artificial intelligence is transforming the role of programmers, but it is not replacing them. AI serves as a tool that enhances and streamlines programming workflows, enabling developers to focus on higher-level tasks. The symbiotic relationship between humans and AI in programming holds the potential for increased productivity, efficiency, and creativity. As we embrace this AI-enabled future, programmers will continue to play a vital role in shaping the development landscape and driving innovation.&lt;/p&gt;

&lt;p&gt;P.S.&lt;br&gt;
This whole blog, except for the P.S. part, was written by AI.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Top Websites To Practice Coding.</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Sun, 23 Jul 2023 09:36:16 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/top-websites-to-practice-coding-553f</link>
      <guid>https://dev.to/certifieddev19960101/top-websites-to-practice-coding-553f</guid>
      <description>&lt;p&gt;Source-Unsplash(Oscar Yildiz)&lt;br&gt;
If you want to improve your coding skills, practice is the only option. But there are some sites that can help us a lot in coding practices and problem solving also expanding our knowledge. In today’s blog, I’m, going to describe them, so you can have the advantage of practicing coding professionally with these sites.&lt;/p&gt;

&lt;p&gt;1) LeetCode&lt;/p&gt;

&lt;p&gt;source-Medium&lt;br&gt;
LeetCode is the best platform to help you enhance your skills, expand your knowledge and prepare for technical interviews. You can practice your code here and LeetCode can help you with this by giving you accurate mistakes analysis. You must use LeetCode to practice Data Structures and Algorithms to increase your chances of getting jobs. There is plenty of questions available for practice, You must try hands-on solving them all.&lt;/p&gt;

&lt;p&gt;2) HackerRank&lt;/p&gt;

&lt;p&gt;source-Wikipedia&lt;br&gt;
HackerRank organizes many Hackathons which are fun to participate in. HackerRank is a place where programmers from all over the world come together to solve problems in a wide range of Computer Science domains such as algorithms, machine learning, or artificial intelligence, as well as to practice different programming paradigms like functional programming. You can also practice your code.&lt;/p&gt;

&lt;p&gt;3) GeekforGeeks&lt;/p&gt;

&lt;p&gt;source-GeekforGeeks&lt;br&gt;
GeekforGeeks is not only for reading articles or getting help for errors in the code. You can also practice your code here, There are many examples that are asked in interviews to practice, So you will have the ease in cracking interviews. You must try GeekforGeeks. Your score is saved on the base of your ability to solve coding problems. You can also maintain streaks If you want to daily practice coding. There are many courses available on their site.&lt;/p&gt;

&lt;p&gt;4) Codechef&lt;/p&gt;

&lt;p&gt;source-Wikipedia&lt;br&gt;
You can Learn competitive programming with the help of CodeChef’s coding competitions. Also, you can take part in these online coding contests to level up your skills. Codechef is the first choice of every competitive programmer. There are many questions available to practice your code. If you’re skilled at solving coding problems the site will rank you world-widely.&lt;/p&gt;

&lt;p&gt;5) CodeForces&lt;/p&gt;

&lt;p&gt;source-GitHub&lt;br&gt;
CodeForces is also the best site to Practice for competitive programming. They organize many competitions among programmers and winners get exciting prizes. If your dream is to become a great competitive programmer, you must practice as many questions as possible and these sites are going to help you a lot. CodeForces is a great place to practice your code. You can practice for coding olympiads also. Here you will be ranked according to your performance.&lt;/p&gt;

&lt;p&gt;6) InterviewBit&lt;/p&gt;

&lt;p&gt;source-InterviewBit&lt;br&gt;
If you are practicing coding to crack tech interviews then InterviewBit is for you. You can get any past year's questions solutions and practice them on the site. You will learn to write error-free, compilable code on your first attempt here if you practice hard.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>7 JavaScript Powerful Optimization Tricks You Need To Know</title>
      <dc:creator>certifieddev0101</dc:creator>
      <pubDate>Thu, 20 Jul 2023 15:39:31 +0000</pubDate>
      <link>https://dev.to/certifieddev19960101/7-javascript-powerful-optimization-tricks-you-need-to-know-3k73</link>
      <guid>https://dev.to/certifieddev19960101/7-javascript-powerful-optimization-tricks-you-need-to-know-3k73</guid>
      <description>&lt;p&gt;Every language has uniqueness, and JavaScript, the most widely used programming language, is no different.&lt;/p&gt;

&lt;p&gt;This blog post will discuss some JavaScript Generic Optimization tricks that will help you write better code and make sure that the following is just not your response when you come all over them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fallback Values
The fallback place to display some adjusting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the value is [] or 0, using logical OR || does not give you the expected results.&lt;/p&gt;

&lt;p&gt;The bullish symbiosis would be a better solution?? If the defined value is null or undefined, only use the fallback values.&lt;/p&gt;

&lt;p&gt;// Lengthy&lt;br&gt;
let name;&lt;br&gt;
if (user?.name) {&lt;br&gt;
  name = user.name;&lt;br&gt;
} else {&lt;br&gt;
  name = "Anonymous";&lt;br&gt;
}&lt;br&gt;
// Shortly&lt;br&gt;
const name = user?.name ?? "Anonymous";&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Shortly For Switching
Long switch cases are commonly maximized by using an object with the keys acting as switches and the values trying to act as return values.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;const dayNumber = new Date().getDay();&lt;br&gt;
// Lengthy&lt;br&gt;
let day;&lt;br&gt;
switch (dayNumber) {&lt;br&gt;
  case 0:&lt;br&gt;
    day = "Sunday";&lt;br&gt;
    break;&lt;br&gt;
  case 1:&lt;br&gt;
    day = "Monday";&lt;br&gt;
    break;&lt;br&gt;
  case 2:&lt;br&gt;
    day = "Tuesday";&lt;br&gt;
    break;&lt;br&gt;
  case 3:&lt;br&gt;
    day = "Wednesday";&lt;br&gt;
    break;&lt;br&gt;
  case 4:&lt;br&gt;
    day = "Thursday";&lt;br&gt;
    break;&lt;br&gt;
  case 5:&lt;br&gt;
    day = "Friday";&lt;br&gt;
    break;&lt;br&gt;
  case 6:&lt;br&gt;
    day = "Saturday";&lt;br&gt;
}&lt;br&gt;
// Shortly&lt;br&gt;
const days = [&lt;br&gt;
    "Sunday",&lt;br&gt;
    "Monday",&lt;br&gt;
    "Tuesday",&lt;br&gt;
    "Wednesday",&lt;br&gt;
    "Thursday",&lt;br&gt;
    "Friday",&lt;br&gt;
    "Saturday",&lt;br&gt;
];&lt;br&gt;
// Or&lt;br&gt;
const days = &lt;code&gt;Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday&lt;/code&gt;.split(&lt;br&gt;
    ","&lt;br&gt;
);&lt;br&gt;
const day = days[dateNumber];&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calls To Functions
You can also use the binary operator to decide which function to call based on conditions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The call patterns of the functions must be the same or you will end up facing errors.&lt;/p&gt;

&lt;p&gt;// Lengthy&lt;br&gt;
function f1() {&lt;br&gt;
  // ...&lt;br&gt;
}&lt;br&gt;
function f2() {&lt;br&gt;
  // ...&lt;br&gt;
}&lt;br&gt;
// Shorter&lt;br&gt;
condition ? f1() : f2();&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Multiple String Checks
It is popular to need to check if a string is equal to one of the multiple values, which can quickly become irritating.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Luckily, JavaScript has a way to help you with this.&lt;/p&gt;

&lt;p&gt;// Lenghty&lt;br&gt;
const isVowel = (letter) =&amp;gt; {&lt;br&gt;
  return (&lt;br&gt;
    letter === "a" ||&lt;br&gt;
    letter === "e" ||&lt;br&gt;
    letter === "i" ||&lt;br&gt;
    letter === "o" ||&lt;br&gt;
    letter === "u"&lt;br&gt;
  );&lt;br&gt;
};&lt;br&gt;
// Shortly&lt;br&gt;
const isVowel = letter =&amp;gt; /[aeiou]/i.test(letter);&lt;br&gt;
For-of and For-in loops are beneficial for repeating over an array or object without having to manually keep track of the index of the object’s keys.&lt;/p&gt;

&lt;p&gt;For-of&lt;/p&gt;

&lt;p&gt;const arr = [1, 2, 3, 4, 5];&lt;br&gt;
// Lengthy&lt;br&gt;
for (let i = 0; i &amp;lt; arr.length; i++) {&lt;br&gt;
  const element = arr[i];&lt;br&gt;
  // ...&lt;br&gt;
}&lt;br&gt;
// Shortly&lt;br&gt;
for (const element of arr) {&lt;br&gt;
  // ...&lt;br&gt;
}&lt;br&gt;
For-in&lt;/p&gt;

&lt;p&gt;const obj = {&lt;br&gt;
  a: 1,&lt;br&gt;
  b: 2,&lt;br&gt;
  c: 3,&lt;br&gt;
};&lt;br&gt;
// Lengthy&lt;br&gt;
const keys = Object.keys(obj);&lt;br&gt;
for (let i = 0; i &amp;lt; keys.length; i++) {&lt;br&gt;
  const key = keys[i];&lt;br&gt;
  const value = obj[key];&lt;br&gt;
  // ...&lt;br&gt;
}&lt;br&gt;
// Shortly&lt;br&gt;
for (const key in obj) {&lt;br&gt;
  const value = obj[key];&lt;br&gt;
  // ...&lt;br&gt;
}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;False Checks
If you want to check if a variable is null, undefined, 0, false, NaN, or a blank string, you can use the Logical Not (!) operator to do so without the need for multiple effects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This makes it simple to verify if a variable contains valid data.&lt;/p&gt;

&lt;p&gt;// Lengthy&lt;br&gt;
const isFalsey = (value) =&amp;gt; {&lt;br&gt;
  if (&lt;br&gt;
    value === null ||&lt;br&gt;
    value === undefined ||&lt;br&gt;
    value === 0 ||&lt;br&gt;
    value === false ||&lt;br&gt;
    value === NaN ||&lt;br&gt;
    value === ""&lt;br&gt;
  ) {&lt;br&gt;
    return true;&lt;br&gt;
  }&lt;br&gt;
  return false;&lt;br&gt;
};&lt;br&gt;
// Shortly&lt;br&gt;
const isFalsey = (value) =&amp;gt; !value;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Secondary Operator
You must have come across the ternary operator as a JavaScript developer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is an excellent method for writing concise if-else statements.&lt;/p&gt;

&lt;p&gt;You can, however, use it to write concise code and even chain it to check for multiple conditions.&lt;/p&gt;

&lt;p&gt;// Lengthy&lt;br&gt;
let info;&lt;br&gt;
if (value &amp;lt; minValue) {&lt;br&gt;
  info = "Value is too small";&lt;br&gt;
} else if (value &amp;gt; maxValue) {&lt;br&gt;
  info = "Value is too large";&lt;br&gt;
} else {&lt;br&gt;
  info = "Value is in range";&lt;br&gt;
}&lt;br&gt;
// Shortly&lt;br&gt;
const info =&lt;br&gt;
  value &amp;lt; minValue&lt;br&gt;
    ? "Value is too small"&lt;br&gt;
    : value &amp;gt; maxValue ? "Value is too large" : "Value is in range";&lt;br&gt;
That’s all there is to it, folks!&lt;/p&gt;

&lt;p&gt;Thank you for taking the time to read this.&lt;/p&gt;

&lt;p&gt;It is completely free to follow!&lt;/p&gt;

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