<?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: Habibullah Bahar Piash</title>
    <description>The latest articles on DEV Community by Habibullah Bahar Piash (@habibullahftl).</description>
    <link>https://dev.to/habibullahftl</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%2F819271%2F20f90763-289e-4564-a9b6-ae2d536af599.jpeg</url>
      <title>DEV Community: Habibullah Bahar Piash</title>
      <link>https://dev.to/habibullahftl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/habibullahftl"/>
    <language>en</language>
    <item>
      <title>How to add custom scrollbar in CSS?</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:57:28 +0000</pubDate>
      <link>https://dev.to/habibullahftl/how-to-add-custom-scrollbar-in-css-5ao0</link>
      <guid>https://dev.to/habibullahftl/how-to-add-custom-scrollbar-in-css-5ao0</guid>
      <description>&lt;p&gt;I have used custom scroll bar on my web applications. I learned a few things when I was trying to use a custom scroll bar using CSS. Here, I will share those things with you.&lt;br&gt;
Let’s start designing the scroll bar…&lt;/p&gt;
&lt;h2&gt;
  
  
  For Chrome/Safari and other modern browsers:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;.  ::-webkit-scrollbar , this pseudo-element is like a container of a scroll bar which is covered by other elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;::-webkit-scrollbar {
   width: 9px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;. ::-webkit-scrollbar-button , this pseudo-element are used for controlling the directional buttons of the scroll bar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;::-webkit-scrollbar-button {
    width: 9px;
    height: 5px;
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3&lt;/strong&gt;. ::-webkit-scrollbar-track , we can style the empty space of a scroll bar using this pseudo-element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;::-webkit-scrollbar-track {
    background: #ddd;
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4&lt;/strong&gt;. ::-webkit-scrollbar-thumb , by using this pseudo-element we can style the thumb of the scroll bar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;::-webkit-scrollbar-thumb {
    background: #f1f1f1;
    width: 8px;
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  For Firefox:
&lt;/h2&gt;

&lt;p&gt;In firebox we can style scroll bar using CSS property scrollbar-color and scrollbar-width:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    overflow-y: scroll;
    scrollbar-color: #3182fc #ddd; // scroll-thumb  and scroll-track
    scrollbar-width: thin; // thin, auto or custom width
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For learning more you can read:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/css-scrollbars"&gt;How To Style Scrollbars with CSS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/almanac/properties/s/scrollbar/"&gt;Scrollbar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/the-current-state-of-styling-scrollbars-in-css/"&gt;The Current State of Styling Scrollbars in CSS&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Few things about ‘Fat Arrow Function’ and Regular Function in JavaScript</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:52:46 +0000</pubDate>
      <link>https://dev.to/habibullahftl/few-things-about-fat-arrow-function-and-regular-function-in-javascript-38ka</link>
      <guid>https://dev.to/habibullahftl/few-things-about-fat-arrow-function-and-regular-function-in-javascript-38ka</guid>
      <description>&lt;p&gt;Arrow Function also called as “fat arrow function”, is the way of writing a function by reducing code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Regular function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const getSum = function(a, b){
    return a + b;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arrow function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const getSum = (a, b) =&amp;gt; a + b;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above two examples, we can see ‘Arrow Function’ allows us to use the fat arrow operator(=&amp;gt;) to define a function. Also, we do not need to use curly braces if there is only one line code inside the function &amp;amp; it will return the value.&lt;br&gt;
&lt;strong&gt;Also, no need to use the ‘return’ keyword to return value. If we write the ‘return’ keyword in one line arrow function, it will show an error.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;N.B.&lt;/strong&gt;: If we want to write multiple line code in an arrow function then we have to use curly braces and inside have to write the ‘return’ keyword to return a value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In one line:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;const greeting = () =&amp;gt; "Hello, there!";&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;In multi-line:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greeting = (name,gender) =&amp;gt; {
  let msg;
  if(gender === "male"){
     msg = "Hello, sir!";
  }else if(gender === "female"){
     msg = "Hello, madam!";
  }
  return msg;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Omitting parentheses:
&lt;/h2&gt;

&lt;p&gt;We can just omit parentheses if there is only one parameter in the arrow function. But, it is not applicable if there is 2 parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  For one parameter in arrow function:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;const greeting = name =&amp;gt;&lt;/code&gt;Hello, ${name}!&lt;code&gt;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Or, can write&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;const greeting = (name) =&amp;gt;&lt;/code&gt;Hello, ${name}!&lt;code&gt;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For two or more parameters:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;const greeting = (fname,lname) =&amp;gt;&lt;/code&gt;Hello, ${fname} ${lname}!&lt;code&gt;;&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ‘this’ keyword in regular function &amp;amp; arrow function:
&lt;/h2&gt;

&lt;p&gt;‘this’ keyword defines the outer object. But, the difference between regular function and arrow function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In the regular function, see the example first:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;businessStudies = {
    name: "Business Studies",
    subjects: ["Accounting","Finance","Marketing"],
    printMessage: function(){
        this.subjects.forEach(function(subName){
        console.log(`${subName} is a subject of ${this.name}`);
        })
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, printMessage method is inside businessStudies object. So, ‘this’ keyword of printMessage method will define the whole businessStudies object. Because printMessage method is a custom method of businessStudies.&lt;br&gt;
But, the ‘this’ keyword inside the callback function of forEach loop will not be defined by the businessStudies object. Because it is not a custom method inside our object. It is a built-in method. So, the ‘this’ keyword inside the regular callback function of the forEach loop will define the whole document(window or global).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In the arrow function, see the example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;businessStudies = {
    name: "Business Studies",
    subjects: ["Accounting","Finance","Marketing"],
    printMessage: function(){
        this.subjects.forEach((subName) =&amp;gt; console.log(`${subName} is a subject of ${this.name} student`))
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Above example, ‘this’ keyword of inside arrow callback function of forEach loop will define the businessStudies object. Because the arrow function deals with the direct outer object. It doesn’t matter that we are using a build-in method or a custom method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>10 Important JavaScript Interview Questions</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:37:14 +0000</pubDate>
      <link>https://dev.to/habibullahftl/10-important-javascript-interview-questions-3m7a</link>
      <guid>https://dev.to/habibullahftl/10-important-javascript-interview-questions-3m7a</guid>
      <description>&lt;p&gt;I am writing here about 10 important JavaScript interview questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  01. Do you know About truthy and falsy value?
&lt;/h2&gt;

&lt;p&gt;As a beginner, it will confuse you which things are truthy and which things are falsy.&lt;/p&gt;

&lt;p&gt;Truthy: All defined values are truthy value(except forfalse, 0, -0, 0n, "", null, undefined, and NaN )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true){ ... }
if ({}){ ... }
if ([]){ ... }
if (42){ ... }
if ("0"){ ... }
if ("false"){ ... }
if (new Date()){ ... }
if (-42){ ... }
if (12n){ ... }
if (3.14){ ... }
if (-3.14){ ... }
if (Infinity){ ... }
if (-Infinity){ ... }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here will be executed the &lt;strong&gt;‘if’ block.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Falsy Values:&lt;/strong&gt; A falsy value is a value that is considered false when encountered in a Boolean context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (false){ ... } else { ... }
if (null){ ... } else { ... }
if (undefined){ ... } else { ... }
if (0){ ... } else { ... }
if (-0){ ... } else { ... }
if (0n){ ... } else { ... }
if (NaN){ ... } else { ... }
if (""){ ... } else { ... }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here will be executed the ‘else’ block.&lt;/p&gt;

&lt;h2&gt;
  
  
  02. Tell me the difference between double equal (==) vs triple equal (===).
&lt;/h2&gt;

&lt;p&gt;Double equal check only value not type. But, triple equal always check value as well as check type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var first = 100;
var second = '100';
if (first == second) { 
    console.log("first value &amp;amp; second value is eqqual")
} esle { 
    console.log("first value &amp;amp; second value is not eqqual")
}
// Output will be "first value &amp;amp; second value is eqqual"
if (first === second) { 
    console.log("first value &amp;amp; second value is eqqual")
} esle { 
    console.log("first value &amp;amp; second value is not eqqual")
}
// Output will be "first value &amp;amp; second value is not eqqual"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  03. Could you tell me the differences between null and undefined?
&lt;/h2&gt;

&lt;p&gt;Here is few differences between null and undefined.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When we create a variable without assigning any value, it will return ‘undefined’.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name; // no value assigned to the variable
console.log(name);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If we write a function without returning anything, it will return ‘undefined’. if we write return but we did not mention what we have returned the result would be ‘undefined’.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(5 &amp;gt; 2) { 
    console.log("Hello, world!");
}
// Output will be ‘undefined’
if(5 &amp;gt; 2) { 
    console.log("Hello, world!");
    return
}
// Output will be ‘undefined’
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The value null represents the intentional absence of any object value.It is one of JavaScript’s primitive values and is treated as falsy for boolean operations.
null means the variable has no value and that is known by the programmer and also value is assigned as null by the programmer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  04. Tell me something about ‘let’ vs ‘const’ vs ‘var’.
&lt;/h2&gt;

&lt;p&gt;We use these keywords to create variables in JavaScript.&lt;br&gt;
&lt;strong&gt;‘var’&lt;/strong&gt; : We declear variables by using ‘var’ keyword. It can be re-assign &amp;amp; it is a global scope variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "Habibullah Bahar";
console.log(name); // Output: "Habibullah Bahar"
name = "Piash";
console.log(name); // Output:"Piash"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;‘let’&lt;/strong&gt; : It is same as ‘var’. But, it is not global scope variable. It is a block scope variable. It’s value can be re-assgin. It’s a feature of ES6.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let profession = "Web Designer";
console.log(profession); // Output: "Web Designer"
profession = "Web Developer";
console.log(profession); // Output:"Web Developer"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;‘const’&lt;/strong&gt; : We can also declear variables using ‘const’ keyword. But, there is restriction. It is not re-assignable &amp;amp; it’s scope is block scope.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const age = 20;
console.log(age); // Output: 20;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  05. ‘this’ keyword.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;‘this’&lt;/strong&gt; keyword refers to an object, that object which is executing the current bit of javascript code. In other words, every javascript function while executing has a reference to its current execution context, called ‘this’. Execution context means here is how the function is called.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default, this refers to the global object&lt;/li&gt;
&lt;li&gt;In an object method, this refers to the object the method was called on&lt;/li&gt;
&lt;li&gt;In a function, when JavaScript is not in strict mode, this refers to the global object&lt;/li&gt;
&lt;li&gt;In a function, when in strict mode, this will be undefined&lt;/li&gt;
&lt;li&gt;In an event handler, this is bound to the HTML element on which the listener is placed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  06. What is global scope in JavaScript?
&lt;/h2&gt;

&lt;p&gt;Scope determines the accessibility (visibility) of variables.&lt;br&gt;
When we declear a variable outside functions, it is a global scope variable. We can access the variable in any function or globally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "Piash";
function person(){
    return "My name is " + name;
}
person(); // Output: "My name is Piash"
console.log(name + " is a full stack web developer");
// Output: "Piash is a full stack web developer"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  07. What is local scope in JavaScript?
&lt;/h2&gt;

&lt;p&gt;If we declared a variable inside of a function then it’s called local variable. We can access the variable inside the function. Outside the function, we can’t access the local variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function person(){
    var name = "Piash";
    return "My name is " + name;
}
person(); // Output: "My name is Piash";
console.log(name + " is a full stack web developer");
// Output: "Undefined is a full stack web developer"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  08. What is closure in JavaScript?
&lt;/h2&gt;

&lt;p&gt;The closure is by default behavior in Javascript. If we declare a function parentFunc() and inside this function we declare another function childFunc(). When we return the parentFunc() and then from childFunc() we can also access the parent function’s variable and object also. It’s happening for Closure in Javascript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function parentFunction(){
    var a = 8;
    function childFunction(){
        var b = 2;
        console.log(a + b); // Output: 10
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  09.How JavaScript code executed?
&lt;/h2&gt;

&lt;p&gt;JavaScript program is run an execution context is created. In this phase, JavaScript allocates the memory to all the variables and functions present in the program. The variables are stored with the value undefined and the function is stored with all the code present in that particular function.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Could you tell me about Private variable in Javascript?
&lt;/h2&gt;

&lt;p&gt;Private variable in javascript is an OOP(Object-oriented programming concepts). Which means which variable we declare as a private variable it can’t be accessible in other classes. It is only accessible in its parent class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is ReactJS? Simple introduction with ReactJS</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:23:54 +0000</pubDate>
      <link>https://dev.to/habibullahftl/what-is-reactjs-simple-introduction-with-reactjs-5652</link>
      <guid>https://dev.to/habibullahftl/what-is-reactjs-simple-introduction-with-reactjs-5652</guid>
      <description>&lt;h2&gt;
  
  
  What is React JS?
&lt;/h2&gt;

&lt;p&gt;React is basically an open-source, javascript library for building user interfaces especially for Single Page Applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  React is a library, not a framework
&lt;/h2&gt;

&lt;p&gt;React is not exactly a “framework”. It is not a complete solution and you will often need to use more libraries with React to form any solution. React does not assume anything about the other parts in any solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  React uses JSX
&lt;/h2&gt;

&lt;p&gt;JSX stands for JavaScript XML. React uses JSX instead of using regular JavaScript. JSX allows us to write HTML in React.&lt;br&gt;
You are not required to use JSX, but JSX makes it easier to write React applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtual DOM
&lt;/h2&gt;

&lt;p&gt;React creates an in-memory data structure cache(a reserved storage location that collects temporary data to help websites, browsers, and apps load faster) which computes the changes made and then updates the browser. This allows a special feature that enables the programmer to code as if the whole page is rendered on each change whereas React library only renders components that actually change.&lt;/p&gt;

&lt;h2&gt;
  
  
  React is all about components
&lt;/h2&gt;

&lt;p&gt;In React, we describe UIs using components that are reusable, composable, and stateful.&lt;br&gt;
We define small components and then put them together to form bigger ones. All components small or big are reusable, even across different projects.&lt;br&gt;
You can think of components as simple functions (in any programming language). We call functions with some input and they give us some output. We can reuse functions as needed and compose bigger functions from smaller ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Some important things should know a JavaScript developer</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 14:51:12 +0000</pubDate>
      <link>https://dev.to/habibullahftl/some-important-things-should-know-a-javascript-developer-1g5e</link>
      <guid>https://dev.to/habibullahftl/some-important-things-should-know-a-javascript-developer-1g5e</guid>
      <description>&lt;p&gt;As I’m a JavaScript learner. I realize that these things will help you understand JavaScript very well. Also, these things will help you to play with JS codes comfortably.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error Handling(try….catch)
&lt;/h2&gt;

&lt;p&gt;When we are writing codes in JavaScript, sometimes our scripts occur error because of our mistake or unexpected user input, or something else.&lt;/p&gt;

&lt;p&gt;There is a nice way to handling errors in JavaScript, this is ‘try…catch’. It allows us to catch errors so that the script can do something instead of dying.&lt;/p&gt;

&lt;p&gt;Syntex of &lt;strong&gt;try…catch&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try { 
     // code… 
} catch (err) { 
     // error handling 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Coding Style
&lt;/h2&gt;

&lt;p&gt;We should write and make our code as clean and easy to read as much as possible. This is the art of programming. Let’s talk about some suggested rules of coding style.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I. Curly Braces&lt;/strong&gt;&lt;br&gt;
Bad Practice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (5 &amp;lt; 7) { alert(“Hello, Piash”); }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good Practice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (5 &amp;lt; 7) { 
    alert(“Hello, Piash”); 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;II. Indents&lt;/strong&gt;&lt;br&gt;
There are two types of indents:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Horizontal indents: 2 or 4 spaces.&lt;/li&gt;
&lt;li&gt;Vertical indents: empty lines for splitting code into logical blocks&lt;/li&gt;
&lt;/ol&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function pow(x, n) { 
    let result = 1; 
    // ← 
    for (let i = 0; i &amp;lt; n; i++) { 
        result *= x; 
    } 
    // ← 
    return result; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;III. Semicolons&lt;/strong&gt;&lt;br&gt;
A semicolon should be present after each statement, even if it could possibly be skipped.&lt;br&gt;
Some programming languages are required to give semicolons after a statement. But, there is no restriction in JavaScript. But, It is good practice to use semicolons after a statement.&lt;br&gt;
You should learn more coding styles. So, you can visit &lt;a href="https://javascript.info/coding-style"&gt;https://javascript.info/coding-style&lt;/a&gt; for learning more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comment in code&lt;/strong&gt;&lt;br&gt;
Comment can make your code more readable to other developers.&lt;br&gt;
There is two way of commenting in JavaScript. One is a single-line comment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Your comment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You also can write a multi-line comment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* 
  your comment 
  write someting
*/ 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can learn more of the good and bad practices of writing comments in JavaScript code from &lt;a href="https://javascript.info/comments"&gt;https://javascript.info/comments&lt;/a&gt; .&lt;/p&gt;

&lt;h2&gt;
  
  
  Features of ES6
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Template Literals in ES6&lt;/strong&gt;&lt;br&gt;
Template Literals is a way to create dynamic strings. You can use variables inside template literals.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "Habibullah";
var age = 20;
var details = `My name is ${name} and my age is ${age}.`; 
// It will give you the output 
// My name is Habibullah and my age is 20.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Destructuring&lt;/strong&gt;&lt;br&gt;
Destructuring is a way to make code clean. Destructuring assignment helps to uncrate the object and arrays into a collection of variables that are easier to handle and work with. It also can be used in functions to reduce the complexity of the functions. Repetition of code is very much decreased by this feature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var person =  {   
   name : "piash",
   age : 20,
   profession: "Web Developer"
} 
let {name,age,profession} = person;
console.log(name); // "Piash"
console.log(age); // 20
console.log(profession); // "Web Developer"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Classes in ES6&lt;/strong&gt;&lt;br&gt;
Previously there was no keyword class to create a class in ES5 for that it was a complex procedure to construct a class and use it. But in ES6 it is easier to work with the class. It uses prototypes, not the function factory method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class baseModel {  
    constructor(options = {}, data = []) { // class constructor 
    this.name = 'Base'
    this.url = 'http://azat.co/api'
    this.data = data 
    this.options = options  
    } 
    getName() { // class method 
       console.log(`Class name: ${this.name}`)    
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>10 Simple But Important Things Of JavaScript</title>
      <dc:creator>Habibullah Bahar Piash</dc:creator>
      <pubDate>Mon, 21 Feb 2022 14:27:04 +0000</pubDate>
      <link>https://dev.to/habibullahftl/10-simple-but-important-things-of-javascript-6a4</link>
      <guid>https://dev.to/habibullahftl/10-simple-but-important-things-of-javascript-6a4</guid>
      <description>&lt;p&gt;If you are a beginner, you should learn these 10 things which is very much. Let's start discussing.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Variables
&lt;/h2&gt;

&lt;p&gt;JavaScript variables are containers for storing data values. There is 3 keyword to declaring variables in JS.&lt;/p&gt;

&lt;p&gt;We can create variables using the ‘let’ and ‘const’ keywords. There are some restrictions. Because they are block scope variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = “Habibullah Bahar”;
const name = “Piash”;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another way to create variable using the ‘var’ keyword. There is no such restriction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var age = 20;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;‘var’ and ‘let’ are reassignable. But, ‘const’ is not reassignable.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Operators
&lt;/h2&gt;

&lt;p&gt;There are four types of operators in JavaScript.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arithmetic Operators:&lt;/strong&gt; +, -, *, /, %, ++, —&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assignment operators:&lt;/strong&gt; =, +=, -=, *=, /=, %=&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparison Operators:&lt;/strong&gt; ==, ===, !=, !== &amp;gt;, &amp;lt;, &amp;gt;=, &amp;lt;=&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logical Operators:&lt;/strong&gt; &amp;amp;&amp;amp;, ||, !&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Data Types
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Primitive Data Types:&lt;/strong&gt; The Primitive Data types in JavaScript include Number, String, Boolean, Undefined, Null, and Symbol. JavaScript primitive data types are data types that refer to a single value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;E.g. var a =5;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the variable ‘a’ is an integer data type and has a single integer value. The variable ‘a’ refers to a single value in memory. If we want to change the value of a, we would have to assign a new value to a. Primitive data types are not mutable.&lt;/p&gt;

&lt;p&gt;Here are Primitive Data Types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;BigInt&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Symbol (new in ES2015)&lt;/li&gt;
&lt;li&gt;null&lt;/li&gt;
&lt;li&gt;Undefined&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Non-Primitive Data Types:&lt;/strong&gt; The Non-Primitive data type has only one member, Object. Function, Array, Date, RegExp, etc. are objects.&lt;/p&gt;

&lt;p&gt;Here are Non-Primitive Data Types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object&lt;/li&gt;
&lt;li&gt;Function&lt;/li&gt;
&lt;li&gt;Array&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;RegExp&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Function
&lt;/h2&gt;

&lt;p&gt;A JavaScript function is a block of code designed to perform a particular task and the code will be executed when it called. Function is re-useable. For calling a function, need to use parentheses(). Ex- function_name().&lt;/p&gt;

&lt;p&gt;For creating a function, you need to use the ‘function’ keyword before function name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function_name(){
....
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also create arrow function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const function_name = () =&amp;gt; {
....
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Events
&lt;/h2&gt;

&lt;p&gt;Events are things that happen to HTML elements. JavaScripts can interact with those events when we use JavaScript in HTML.&lt;/p&gt;

&lt;p&gt;Here are some common events:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;onclick&lt;/li&gt;
&lt;li&gt;onchange&lt;/li&gt;
&lt;li&gt;onload&lt;/li&gt;
&lt;li&gt;onkeyup&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. DOM (Document Object Model)
&lt;/h2&gt;

&lt;p&gt;Javascript can add, remove &amp;amp; change all the elements, attributes &amp;amp; CSS styling. JS can create &amp;amp; react to all HTML events. (click,hover,keyup,keydown etc.) In the DOM, all HTML elements are defined as objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  07. Error Handling
&lt;/h2&gt;

&lt;p&gt;You have to know error handling when you write JS codes. In the new version of JavaScript, there are few ways to handle errors. Like, console.log, console. error, try…catch, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  08. Debugging
&lt;/h2&gt;

&lt;p&gt;It is also important for a JavaScript developer. You have to learn how to identify &amp;amp; fix errors and bugs in your application. Most web browsers notify developer about errors but different browser shows errors in different ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  09. Conditions
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;JavaScript&lt;/strong&gt;, there are few conditional statements. Use if to specify a block of code to be executed, if a specified condition is true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;if(Condition){….}&lt;/strong&gt;: Use if to specify a block of code to be executed, if a specified condition is true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;while(condition){….}&lt;/strong&gt;: If the condition is true then the code block will be executed and it will be executed until the condition is not false.&lt;/p&gt;

&lt;p&gt;There are more conditional statements to write codes conditionally.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Form Validation
&lt;/h2&gt;

&lt;p&gt;We can validate forms using JavaScript before sending data to the server. We can set a mandatory field or optional in JS.&lt;/p&gt;

&lt;p&gt;Also, we can check that the data is in the right format, structure, or not.&lt;/p&gt;

&lt;p&gt;We will discuss more in the other articles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Portfolio Website&lt;/strong&gt;: &lt;a href="https://habibullahftl.web.app/"&gt;https://habibullahftl.web.app/&lt;/a&gt;&lt;/p&gt;

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