<?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: Shadab Ali</title>
    <description>The latest articles on DEV Community by Shadab Ali (@shacodes).</description>
    <link>https://dev.to/shacodes</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%2F83092%2Feac1bd18-69bc-4ce4-acd1-c0a90f792077.png</url>
      <title>DEV Community: Shadab Ali</title>
      <link>https://dev.to/shacodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shacodes"/>
    <language>en</language>
    <item>
      <title>[HELP]I want to convert my react/next js component file to text.</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Tue, 24 Oct 2023 08:16:35 +0000</pubDate>
      <link>https://dev.to/shacodes/i-want-to-convert-my-reactnext-js-component-file-to-text-26ph</link>
      <guid>https://dev.to/shacodes/i-want-to-convert-my-reactnext-js-component-file-to-text-26ph</guid>
      <description>&lt;p&gt;I want to convert my react/next js component file to text.&lt;/p&gt;

&lt;p&gt;let a.jsx&lt;/p&gt;

&lt;p&gt;"use client"&lt;/p&gt;

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

&lt;p&gt;const Test = () =&amp;gt; {&lt;br&gt;
  const [number, setNumber] = useState(1)&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      &lt;span&gt;{number}&lt;/span&gt;&lt;br&gt;
      
        onClick={() =&amp;gt; {&lt;br&gt;
          setNumber(number + 1)&lt;br&gt;
        }}&lt;br&gt;
      &amp;gt;&lt;br&gt;
        increment&lt;br&gt;
      &lt;br&gt;
    &lt;br&gt;
  )&lt;br&gt;
}&lt;br&gt;
export default Test

&lt;p&gt;when the user clicks on show code for some component I want to show the exact file. with all import and hooks and etc&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/77337786/how-to-get-react-next-js-component-file-as-text" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/77337786/how-to-get-react-next-js-component-file-as-text&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>Job apply script for hirist and instahyre platform</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Sat, 12 Aug 2023 12:43:22 +0000</pubDate>
      <link>https://dev.to/shacodes/job-apply-script-for-hirist-and-instahyre-platform-m05</link>
      <guid>https://dev.to/shacodes/job-apply-script-for-hirist-and-instahyre-platform-m05</guid>
      <description>&lt;p&gt;I found this amazing video for job apply automation script &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ceUtkPcfDsI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>jobs</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Currying vs Pipe in javascript</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Mon, 24 Jul 2023 07:02:18 +0000</pubDate>
      <link>https://dev.to/shacodes/currying-vs-pipe-in-javascript-4m9</link>
      <guid>https://dev.to/shacodes/currying-vs-pipe-in-javascript-4m9</guid>
      <description>&lt;p&gt;In JavaScript, both pipe and currying are functional programming techniques that can be used to compose functions in different ways. Here's an explanation of each:&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://frontendchef.com/currying-vs-pipe-in-javascript/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--acb8Hx4n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://frontendchef.com/wp-content/uploads/2023/06/Black-Gradient-Branding-Tips-Seamless-Carousel-Instagram-Post-1024x1024.png" height="800" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://frontendchef.com/currying-vs-pipe-in-javascript/" rel="noopener noreferrer" class="c-link"&gt;
          Currying vs Pipe in javascript - Frontendchef
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Currying vs Pipe in Javascript Explore the differences between currying and piping in JavaScript. Currying vs Pipe in javascript interview-question Currying vs Pipe in javascript
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--gA1Bobfv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://frontendchef.com/wp-content/uploads/2023/05/cropped-android-chrome-512x512-1-32x32.png" width="32" height="32"&gt;
        frontendchef.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A Journey Through 6 Months of Backend Engineering: Building Robust Foundations</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Sat, 22 Jul 2023 22:32:47 +0000</pubDate>
      <link>https://dev.to/shacodes/a-journey-through-6-months-of-backend-engineering-building-robust-foundations-ja8</link>
      <guid>https://dev.to/shacodes/a-journey-through-6-months-of-backend-engineering-building-robust-foundations-ja8</guid>
      <description>&lt;p&gt;Discover the ultimate guide to backend engineering with our six-month roadmap. Learn how to build robust and scalable infrastructures, from planning and architecture design to testing and maintenance. Unlock the secrets of successful backend development and equip yourself with the skills to thrive in the dynamic world of software engineering. Start your journey now!&lt;/p&gt;

&lt;h2&gt;
  
  
  Month 1: Introduction to Backend Technologies
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Week 1: Introduction to Backend Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understand client-server architecture&lt;br&gt;
Learn about HTTP, APIs, and RESTful principles&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 2: Setting Up Development Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install necessary software (e.g., text editor, Git, Node.js, etc.)&lt;br&gt;
Familiarize yourself with the command-line interface (CLI)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 3: Basics of Database Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learn about relational and NoSQL databases&lt;br&gt;
Practice basic CRUD operations (Create, Read, Update, Delete)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 4: Web Development Framework&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Choose a backend framework (e.g., Express.js for Node.js)&lt;br&gt;
Build a simple API using the chosen framework&lt;/p&gt;

&lt;p&gt;read full schedule at &lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://frontendchef.com/6-month-backend-engineering-schedule/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--kbX-J5Cc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://frontendchef.com/wp-content/uploads/2023/07/cover.png" height="435" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://frontendchef.com/6-month-backend-engineering-schedule/" rel="noopener noreferrer" class="c-link"&gt;
          6 Months Backend engineering schedule - Frontendchef
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Unveil the 6-month backend engineering roadmap - from planning to maintenance. Build robust infrastructures and thrive in software development. Begin now! 6-month backend engineering schedule backend development roadmap backend engineering guide
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--gA1Bobfv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://frontendchef.com/wp-content/uploads/2023/05/cropped-android-chrome-512x512-1-32x32.png" width="32" height="32"&gt;
        frontendchef.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>backend</category>
      <category>tutorial</category>
      <category>javascript</category>
    </item>
    <item>
      <title>ESSENTIAL JOB SEARCH TEMPLATES FOR SOFTWARE ENGINEERS</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Sat, 29 Apr 2023 13:11:24 +0000</pubDate>
      <link>https://dev.to/shacodes/essential-job-search-templates-for-software-engineers-44h1</link>
      <guid>https://dev.to/shacodes/essential-job-search-templates-for-software-engineers-44h1</guid>
      <description>&lt;p&gt;If you're a software engineer looking for a new job, you know that job hunting can be overwhelming. But fear not, as Frontendchef has the solution to streamline your job search and help you land your dream job faster.&lt;/p&gt;

&lt;p&gt;In addition to providing essential job search templates, Frontendchef added a #job #automation #script specifically designed for job sites like Hirist and Instahyre. With this script, you can save time and effort by automating your job application process.&lt;/p&gt;

&lt;p&gt;Say goodbye to job search stress and hello to your dream job!&lt;br&gt;
Look no forward than Frontendchef blog post&lt;/p&gt;

&lt;p&gt;&lt;a href="https://frontendchef.com/essential-job-search-templates-for-software-engineers" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>job</category>
      <category>javascript</category>
    </item>
    <item>
      <title>10 ways to earn as software developer</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Sat, 31 Dec 2022 13:57:22 +0000</pubDate>
      <link>https://dev.to/shacodes/10-ways-to-earn-as-softwere-developer-18b</link>
      <guid>https://dev.to/shacodes/10-ways-to-earn-as-softwere-developer-18b</guid>
      <description>&lt;p&gt;1 : Freelancing: You can offer your software development services on a freelance basis to clients around the world. You can find freelance work through online platforms like Upwork, Freelancer, and Toptal, or you can reach out directly to potential clients through networking and marketing efforts.&lt;/p&gt;

&lt;p&gt;Consultancy: Another option is to start your own consultancy and offer software development services to clients on a contract basis. This can be a good option if you have a lot of experience and expertise in a particular area and want to work with a variety of clients.&lt;/p&gt;

&lt;p&gt;Product development: If you have an idea for a software product, you can create it and sell it to customers. This can be a challenging and time-consuming process, but it can also be very rewarding if your product is successful.&lt;/p&gt;

&lt;p&gt;In-house development: You can also work as an in-house software developer for a company, where you will be responsible for developing and maintaining software for the company's internal use.&lt;/p&gt;

&lt;p&gt;Open-source contributions: You can contribute to open-source projects and earn money through donations or by offering paid support and consulting services to users of the project.&lt;/p&gt;

&lt;p&gt;Teaching: If you have a lot of experience and knowledge in software development, you can consider teaching others through online courses or in-person workshops.&lt;/p&gt;

&lt;p&gt;Writing: You can write technical articles or books on software development and earn money through publishing or by offering your writing services to clients.&lt;/p&gt;

&lt;p&gt;Speaking: You can also earn money by speaking at conferences or events about software development. This can be a great way to share your knowledge and experience with others while also earning income.&lt;/p&gt;

&lt;p&gt;Contract work: You can work as a contractor for a company on a short-term basis, completing specific software development projects for them.&lt;/p&gt;

&lt;p&gt;Starting a business: Another option is to start your own software development business, either as a solo entrepreneur or with a team of developers. This can be a challenging but rewarding way to earn money as a software developer.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>How to become css master ?</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Thu, 29 Dec 2022 09:12:00 +0000</pubDate>
      <link>https://dev.to/shacodes/how-to-become-css-master--3ea8</link>
      <guid>https://dev.to/shacodes/how-to-become-css-master--3ea8</guid>
      <description>&lt;p&gt;To become a CSS master, you will need to learn and master the following skills:&lt;/p&gt;

&lt;p&gt;HTML and CSS basics: You should be familiar with the basic syntax of HTML and CSS and how they are used to structure and style content on the web.&lt;/p&gt;

&lt;p&gt;Responsive design: You should be able to design and build responsive websites that look and function well on a variety of devices, including desktop computers, tablets, and smartphones.&lt;/p&gt;

&lt;p&gt;Layout techniques: You should be able to create flexible and advanced layouts using techniques such as floats, flexbox, and grid.&lt;/p&gt;

&lt;p&gt;CSS preprocessors: You should be familiar with CSS preprocessors like Sass or Less, which allow you to write more efficient and maintainable CSS code.&lt;/p&gt;

&lt;p&gt;CSS frameworks: You should be familiar with popular CSS frameworks like Bootstrap and Foundation, which provide a set of predefined styles and layout components that can be easily customized to fit the needs of your project.&lt;/p&gt;

&lt;p&gt;Browser compatibility: You should be aware of browser compatibility issues and know how to troubleshoot and fix them.&lt;/p&gt;

&lt;p&gt;Accessibility: You should be familiar with web accessibility standards and know how to create accessible websites that are usable by people with disabilities.&lt;/p&gt;

&lt;p&gt;To develop these skills, you can start by learning online through tutorials and online courses, or by working on small projects on your own. As you gain experience and become more comfortable with CSS, you can take on more complex projects and challenges to continue improving your skills.&lt;/p&gt;

</description>
      <category>blazor</category>
      <category>react</category>
      <category>typescript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>is Data Structures and Algorithms necessary for frontend developer ?</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Thu, 29 Dec 2022 09:10:09 +0000</pubDate>
      <link>https://dev.to/shacodes/is-data-structures-and-algorithms-necessary-for-frontend-developer--o4n</link>
      <guid>https://dev.to/shacodes/is-data-structures-and-algorithms-necessary-for-frontend-developer--o4n</guid>
      <description>&lt;p&gt;DSA, or Data Structures and Algorithms, is not necessarily a requirement for frontend developers. However, having a strong understanding of DSA can be beneficial for frontend developers in a number of ways.&lt;/p&gt;

&lt;p&gt;For example, DSA concepts such as searching and sorting algorithms can be useful for optimizing the performance of frontend code, particularly when working with large data sets. In addition, a deep understanding of DSA can help frontend developers design and implement more efficient and scalable solutions to problems that they may encounter in their work.&lt;/p&gt;

&lt;p&gt;That being said, it is not necessary for all frontend developers to have a deep understanding of DSA. It really depends on the specific requirements of the job and the individual developer's interests and goals. Some frontend developers may choose to focus more on design and user experience, while others may be more interested in the technical aspects of the job and want to develop their skills in DSA and other areas of computer science.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>How to become frontend developer</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Thu, 29 Dec 2022 09:06:42 +0000</pubDate>
      <link>https://dev.to/shacodes/how-to-become-frontend-developer-md1</link>
      <guid>https://dev.to/shacodes/how-to-become-frontend-developer-md1</guid>
      <description>&lt;p&gt;Becoming a frontend developer typically involves learning how to build and maintain the user-facing side of websites and applications. Here are some steps you can take to start your journey towards becoming a frontend developer:&lt;/p&gt;

&lt;p&gt;1 : Learn HTML, CSS, and JavaScript: These are the core technologies used to build the frontend of websites and applications. HTML is used to structure content on the web, CSS is used to style and layout that content, and JavaScript is used to add interactivity and dynamic behavior to web pages. There are many online resources and tutorials available for learning these languages, such as Codecademy and freeCodeCamp.&lt;/p&gt;

&lt;p&gt;2 : Practice building web pages and applications: As you learn the core technologies, put your skills into practice by building small web pages and applications. This will give you a chance to apply what you've learned and see how the different technologies work together.&lt;/p&gt;

&lt;p&gt;3 : Learn about modern frontend frameworks and libraries: There are many frameworks and libraries available that can help you build more complex and interactive web applications more efficiently. Some popular choices include React, Angular, and Vue.js.&lt;/p&gt;

&lt;p&gt;3 : Stay up to date with the latest developments: The field of web development is constantly evolving, with new technologies and best practices being introduced all the time. Make an effort to stay up to date with the latest developments in the field by reading blogs, attending meetups and conferences, and following industry leaders on social media.&lt;/p&gt;

&lt;p&gt;4 : Consider earning a degree or certification: While it's not strictly necessary to have a degree or certification to become a frontend developer, earning a formal education in computer science or a related field can help you develop a strong foundation in the underlying principles of computer science and give you a competitive edge in the job market.&lt;/p&gt;

&lt;p&gt;5 : Build a portfolio: As you build web pages and applications, be sure to document your work and add it to a portfolio. A portfolio is a great way to demonstrate your skills and experience to potential employers and clients.&lt;/p&gt;

&lt;p&gt;I hope this helps! If you have any other questions about becoming a frontend developer, feel free to ask.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Default vs Named exports</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Sat, 15 Oct 2022 14:47:09 +0000</pubDate>
      <link>https://dev.to/shacodes/default-vs-named-exports-19hj</link>
      <guid>https://dev.to/shacodes/default-vs-named-exports-19hj</guid>
      <description>&lt;p&gt;There are two primary ways to export values with JavaScript: default exports and named exports. But you can use one or both of them in the same file. A file can have not more than one default export, but it can have as many named exports as you like&lt;/p&gt;

&lt;p&gt;Export Statements:&lt;br&gt;
&lt;code&gt;export default function Button() {} // default export &lt;br&gt;
export function Button() {}  // named export&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Import Statements:&lt;br&gt;
&lt;code&gt;import  Button  from './button.js';   // default export &lt;br&gt;
import { Button } from './button.js';   // Named export&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When you write a default import, you can put any name you want after import. &lt;br&gt;
For example, you could write &lt;br&gt;
&lt;code&gt;import Banana from './button.js'&lt;/code&gt;&lt;br&gt;
and it would still provide you with the same default export. &lt;br&gt;
In contrast, with named imports, the name has to match on both sides. That’s why they are called named imports!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>How to make projects as a fresher</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Fri, 30 Sep 2022 17:21:37 +0000</pubDate>
      <link>https://dev.to/shacodes/how-to-make-projects-as-fresher-akc</link>
      <guid>https://dev.to/shacodes/how-to-make-projects-as-fresher-akc</guid>
      <description>&lt;p&gt;Hello all&lt;/p&gt;

&lt;p&gt;If you are freshers or just learning things don't just directly jump on your idea of creating Facebook or another LinkedIn&lt;/p&gt;

&lt;p&gt;🔥 Start with an easy project then slowly move towards complex projects  (make 6 to 7 projects)&lt;/p&gt;

&lt;p&gt;🔥 List down all the functionality you want literally all&lt;/p&gt;

&lt;p&gt;🔥 Then sort on the basis of  "MVP", "must have", "good to have"," time Raha to bna duga", &lt;/p&gt;

&lt;p&gt;🔥 Draw a bare minimum design on paper or Figma So that you don't have to refactor every time  And have a clear idea of what you are building &lt;/p&gt;

&lt;p&gt;🔥 Host your project somewhere no one is going to look them on  your localhost&lt;/p&gt;

&lt;p&gt;🔥 Prepare a demo video host on YouTube (give a demo like you are giving a demo to clients believe me in the industry this is a very good skill and every developer has to give a demo to an actual client)&lt;/p&gt;

&lt;p&gt;🔥 Challenge your friends to find bugs in it (bug nikaal dia to party duga)&lt;/p&gt;

&lt;p&gt;🔥 Make projects in a timely manner (another very good trait of developers, in your job you have to give timelines for features, make sprints, and plan everything) don't demotivate yourself if you fail to develop in the sprint in the job , developers also fail to deliver the project on time &lt;/p&gt;

&lt;p&gt;🔥 Make a readme file the impact of the readme is very good when the interviewer look at the project this shows that you care about your project and haven't developed it just for the sake of the job &lt;/p&gt;

&lt;p&gt;Follow me on LinkedIn for more content &lt;a href="https://www.linkedin.com/in/shadab-ali" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/shadab-ali&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Creates an array with all falsy values removed. The values false, null, 0, "", undefined, and NaN are falsy.</title>
      <dc:creator>Shadab Ali</dc:creator>
      <pubDate>Wed, 28 Sep 2022 06:57:41 +0000</pubDate>
      <link>https://dev.to/shacodes/creates-an-array-with-all-falsy-values-removed-the-values-false-null-0-undefined-and-nan-are-falsy-5h96</link>
      <guid>https://dev.to/shacodes/creates-an-array-with-all-falsy-values-removed-the-values-false-null-0-undefined-and-nan-are-falsy-5h96</guid>
      <description>&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;Q: Implement lodash compact function&lt;/p&gt;

&lt;p&gt;INPUT:&lt;br&gt;
const array=[1, null , 0 , 2 , 3 , 4 , 5 ," " , undefined , NaN];&lt;/p&gt;

&lt;p&gt;OUTPUT : [1, 2, 3, 4, 5]&lt;/p&gt;

&lt;p&gt;======================================&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function compact(ar){
let newArr=[];
for(let i=0;i&amp;lt; ar.length;i++){
if(!(ar[i] === false || ar[i] === null || ar[i] === 0 || ar[i] === "" || ar[i] === undefined || (typeof ar[i] == 'number' &amp;amp;&amp;amp; !ar[i]) ))
{
newArr.push(ar[i])
}
}
return newArr
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;====================================&lt;/p&gt;

&lt;p&gt;The best and easy approach in the comment&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
