<?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: Jahid Iqbal</title>
    <description>The latest articles on DEV Community by Jahid Iqbal (@hrid620).</description>
    <link>https://dev.to/hrid620</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%2F777240%2Ffb3e643c-2c5e-4fa8-b7e3-c1ce9f354701.jpg</url>
      <title>DEV Community: Jahid Iqbal</title>
      <link>https://dev.to/hrid620</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hrid620"/>
    <language>en</language>
    <item>
      <title>JavaScript কীভাবে কাজ করে ?</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Mon, 16 Jun 2025 19:13:49 +0000</pubDate>
      <link>https://dev.to/hrid620/javascript-kiibhaabe-kaaj-kre--24nm</link>
      <guid>https://dev.to/hrid620/javascript-kiibhaabe-kaaj-kre--24nm</guid>
      <description>&lt;p&gt;আমরা সবাই কোড লিখি বা বিভিন্ন প্রজেক্টে জাভাস্ক্রিপ্ট ব্যবহার করি, কিন্তু কি কখনো ভেবেছেন—আপনার লেখা সেই কোডটা আসলে বিহাইন্ড দ্যা সিন কীভাবে কাজ করে ? এই প্রসেস নিয়ে আমারও প্রথমে কিছু কনফিউশন ছিল।তাই আজ সহজ ভাষায় পুরো প্রক্রিয়াটি ব্যাখ্যা করার চেষ্টা করছি, আশা করি, আপনিও এই বিষয়গুলো সহজেই বুঝতে পারবেন।&lt;/p&gt;

&lt;p&gt;★ &lt;strong&gt;JavaScript Engine&lt;/strong&gt;&lt;br&gt;
আপনার কোডটি প্রথমে যায় JavaScript Engine-এ (যেমন Chrome-এ V8 Engine)।&lt;/p&gt;

&lt;p&gt;★ &lt;strong&gt;Parser&lt;/strong&gt;&lt;br&gt;
 ইঞ্জিনের ভিতরে একটি Parser থাকে, যেটা কোড লাইন বাই লাইন পড়ে দেখে—সিনট্যাক্স ঠিক আছে কি না।a&lt;/p&gt;

&lt;p&gt;★ &lt;strong&gt;AST – Abstract Syntax Tree&lt;/strong&gt;&lt;br&gt;
যদি কোড ঠিকঠাক থাকে, তখন তা থেকে তৈরি হয় একটি AST (Abstract Syntax Tree)।এই AST এক ধরনের গঠনমূলক ম্যাপ, যেটা দেখিয়ে দেয় কোডের গঠন কেমন — কোনটা ফাংশন, কোনটা ভ্যারিয়েবল, কোনটা লজিক ইত্যাদি।&lt;/p&gt;

&lt;p&gt;★ &lt;strong&gt;Machine Code&lt;/strong&gt;&lt;br&gt;
AST-এর সাহায্যে কোডটি এরপর Machine Code-এ রূপান্তরিত হয় — মানে এমন কোড যা কম্পিউটার সরাসরি বুঝতে পারে।&lt;/p&gt;

&lt;p&gt;★ &lt;strong&gt;Execution&lt;/strong&gt;&lt;br&gt;
সবশেষে Machine Code চলে যায় প্রসেসরে, যেখানে সেটা রান হয়, আর তখনই কোডটা বাস্তবে কাজ করতে শুরু করে।&lt;/p&gt;

&lt;p&gt;📌 তাহলে সংক্ষেপে JavaScript এইভাবে কাজ করে:&lt;br&gt;
Code → Parser → AST → Machine Code → Processor → Execution&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>𝐃𝐣𝐚𝐧𝐠𝐨-এর 𝐑𝐞𝐪𝐮𝐞𝐬𝐭-𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐞 𝐋𝐢𝐟𝐞𝐜𝐲𝐜𝐥𝐞 বাংলায় এক নজরে!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Sat, 15 Mar 2025 13:57:58 +0000</pubDate>
      <link>https://dev.to/hrid620/-er-baanlaay-ek-njre-2png</link>
      <guid>https://dev.to/hrid620/-er-baanlaay-ek-njre-2png</guid>
      <description>&lt;p&gt;কয়েক সপ্তাহ ধরে Django নিয়ে কাজ করছি। ভাবলাম, Django-এর Request Response &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5od1wjd05jd2uybon9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr5od1wjd05jd2uybon9e.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;Lifecycle নিয়ে যতটুকু পড়েছি এবং বুঝতে পেরেছি সেটাই আজ শেয়ার করছি।&lt;/p&gt;

&lt;p&gt;𝟭: 𝗖𝗹𝗶𝗲𝗻𝘁 𝗥𝗲𝗾𝘂𝗲𝘀𝘁 পাঠানো&lt;br&gt;
যখন একজন ব্যবহারকারী ব্রাউজারে কোনো URL-এ প্রবেশ করে, তখন একটি HTTP request (GET, POST ইত্যাদি) সার্ভারের কাছে পাঠানো হয়।&lt;/p&gt;

&lt;p&gt;𝟮: 𝗨𝗥𝗟 𝗥𝗼𝘂𝘁𝗶𝗻𝗴&lt;br&gt;
Django প্রথমে urls. py ফাইলে যায় , কোন URL প্যাটার্নের সাথে request টি  মিলে কিনা চেক করে । যদি URL সঠিক হয়, তাহলে সেটি নির্দিষ্ট view ফাংশনে পাঠানো হয়।&lt;/p&gt;

&lt;p&gt;&lt;code&gt;urlpatterns = [&lt;br&gt;
 path('home/', views.home, name='home'),&lt;br&gt;
]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;𝟯: 𝗩𝗶𝗲𝘄 &lt;br&gt;
View ফাংশন request টি গ্রহণ করে এবং লজিক (Business logic) অনুযায়ী ডেটা প্রসেস করে।&lt;/p&gt;

&lt;p&gt;&lt;code&gt;def home(request):&lt;br&gt;
 return HttpResponse('Hello, Django!')&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;এখানে view থেকে response তৈরি করা হয়, যেমন HTML, JSON ইত্যাদি।&lt;/p&gt;

&lt;p&gt;𝟰: 𝗠𝗼𝗱𝗲𝗹 এবং 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗔𝗰𝗰𝗲𝘀𝘀 (যদি প্রয়োজন হয়)&lt;br&gt;
যদি ডেটাবেস থেকে ডেটা প্রয়োজন হয়, তাহলে view মডেলের (Model) মাধ্যমে ডেটাবেসের সাথে যোগাযোগ করে।&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class Product(models.Model):&lt;br&gt;
 name = models.CharField(max_length=100)&lt;br&gt;
 price = models.FloatField()&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
𝟱: 𝗧𝗲𝗺𝗽𝗹𝗮𝘁𝗲 𝗥𝗲𝗻𝗱𝗲𝗿𝗶𝗻𝗴&lt;br&gt;
যদি HTML বা Frontend এর প্রয়োজন হয়, তাহলে view ফাংশন template-এ ডেটা পাঠিয়ে রেন্ডার করে।&lt;/p&gt;

&lt;p&gt;&lt;code&gt;def home(request):&lt;br&gt;
 context = {'message': 'Hello, Django Template!'}&lt;br&gt;
 return render(request, 'home.html', context)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;𝟲: 𝗥𝗲𝘀𝗽𝗼𝗻𝘀𝗲 &lt;br&gt;
সবশেষে view থেকে response (যেমন HttpResponse, JsonResponse) ব্রাউজারের দিকে পাঠানো হয়।&lt;/p&gt;

&lt;p&gt;𝗦𝘁𝗲𝗽 𝟳: 𝗖𝗹𝗶𝗲𝗻𝘁 এ 𝗥𝗲𝘀𝗽𝗼𝗻𝘀𝗲 প্রদর্শন&lt;br&gt;
ব্রাউজার response গ্রহণ করে এবং ব্যবহারকারীর সামনে ফলাফল প্রদর্শন করে।&lt;/p&gt;

&lt;p&gt;🎯 সংক্ষেপে:&lt;br&gt;
✅ Client Request → URL Routing → View Processing → Model Access → Template Rendering → Response পাঠানো → Client এ Response প্রদর্শন&lt;/p&gt;

&lt;p&gt;এইভাবেই Django-এর পুরো Request-Response Lifecycle সম্পন্ন হয়!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>𝐃𝐞𝐟𝐢𝐧𝐞 𝐩𝐨𝐩,𝐩𝐮𝐬𝐡,𝐬𝐡𝐢𝐟𝐭,𝐮𝐧𝐬𝐡𝐢𝐟𝐭 𝐌𝐞𝐭𝐡𝐨𝐝𝐬 𝐢𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Thu, 24 Mar 2022 06:00:47 +0000</pubDate>
      <link>https://dev.to/hrid620/-46o2</link>
      <guid>https://dev.to/hrid620/-46o2</guid>
      <description>&lt;p&gt;&lt;strong&gt;𝐩𝐨𝐩():&lt;/strong&gt; 𝑅𝑒𝑚𝑜𝑣𝑒 an item from the 𝑒𝑛𝑑 of an 𝑎𝑟𝑟𝑎𝑦.&lt;/p&gt;

&lt;p&gt;𝐸𝑥𝑎𝑚𝑝𝑙𝑒&lt;br&gt;
let players = ['Shakib', 'Tamim', 'Mushfiq'];&lt;br&gt;
players.pop();  // ['Shakib', 'Tamim'] &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝐬𝐡𝐢𝐟𝐭():&lt;/strong&gt;𝑅𝑒𝑚𝑜𝑣𝑒 an item from the 𝑏𝑒𝑔𝑖𝑛𝑛𝑖𝑛𝑔 of an array.&lt;/p&gt;

&lt;p&gt;𝐸𝑥𝑎𝑚𝑝𝑙𝑒&lt;br&gt;
let players = ['Shakib', 'Tamim','Mushfiq' ];&lt;br&gt;
players.shift();  // ['Tamim','Mushfiq']&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝐩𝐮𝐬𝐡():&lt;/strong&gt; 𝐴𝑑𝑑 items to the 𝑒𝑛𝑑 of an array.&lt;/p&gt;

&lt;p&gt;𝐸𝑥𝑎𝑚𝑝𝑙𝑒&lt;br&gt;
let rivers= ['Meghna'];&lt;br&gt;
rivers.push('Jamuna'); // ['Meghna', 'Jamuna']&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝐮𝐧𝐬𝐡𝐢𝐟𝐭():&lt;/strong&gt; 𝐴𝑑𝑑 items to the 𝑏𝑒𝑔𝑖𝑛𝑛𝑖𝑛𝑔 of an array.&lt;/p&gt;

&lt;p&gt;𝐸𝑥𝑎𝑚𝑝𝑙𝑒&lt;br&gt;
let fruits= ['Mango'];&lt;br&gt;
fruits.unshift('Orange'); // ['Orange', 'Mango']&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>𝐁𝐢𝐧𝐝, 𝐂𝐚𝐥𝐥, 𝐚𝐧𝐝 𝐀𝐩𝐩𝐥𝐲 𝐌𝐞𝐭𝐡𝐨𝐝𝐬 𝐢𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Thu, 24 Mar 2022 05:58:21 +0000</pubDate>
      <link>https://dev.to/hrid620/--5531</link>
      <guid>https://dev.to/hrid620/--5531</guid>
      <description>&lt;p&gt;&lt;strong&gt;𝗕𝗶𝗻𝗱&lt;/strong&gt;&lt;br&gt;
The bind method creates a new function and sets ‘this’ keyword to the specified object.&lt;/p&gt;

&lt;p&gt;𝑬𝒙𝒂𝒎𝒑𝒍𝒆:&lt;br&gt;
const showNum= {&lt;br&gt;
  num: 50,&lt;br&gt;
  getNum: function() {&lt;br&gt;
   return this.num;&lt;br&gt;
  }&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;const unboundGetNum = showNum.getNum;&lt;br&gt;
console.log(unboundGetNum());&lt;br&gt;
// The function gets invoked at the global scope&lt;br&gt;
// expected output: undefined&lt;/p&gt;

&lt;p&gt;const boundGetNum= unboundGetNum.𝗯𝗶𝗻𝗱(showNum);&lt;br&gt;
console.log(boundGetNum());&lt;br&gt;
// expected output: 50&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝐂𝐚𝐥𝐥&lt;/strong&gt;&lt;br&gt;
The call method sets “this” inside the function and immediately executes that function. Call() accepts 𝘤𝘰𝘮𝘮𝘢-𝘴𝘦𝘱𝘢𝘳𝘢𝘵𝘦𝘥 list of arguments.&lt;/p&gt;

&lt;p&gt;𝑬𝒙𝒂𝒎𝒑𝒍𝒆:&lt;br&gt;
function Gadget(name, price) {&lt;br&gt;
this.name = name;&lt;br&gt;
this.price = price;&lt;br&gt;
}&lt;br&gt;
function Laptop(name, price) {&lt;br&gt;
Gadget.𝗰𝗮𝗹𝗹(this, name, price);&lt;br&gt;
this.category = 'laptop';&lt;br&gt;
}&lt;br&gt;
console.log(new Laptop('Asus', 5).name);&lt;br&gt;
// expected output: "Asus"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝗔𝗽𝗽𝗹𝘆&lt;/strong&gt;&lt;br&gt;
The apply() method is similar to call(). The difference is that the apply() method accepts an 𝑎𝑟𝑟𝑎𝑦 𝑜𝑓 𝑎𝑟𝑔𝑢𝑚𝑒𝑛𝑡𝑠 instead of comma separated values.&lt;/p&gt;

&lt;p&gt;𝑬𝒙𝒂𝒎𝒑𝒍𝒆:&lt;br&gt;
const person = {&lt;br&gt;
  firstName: 'Jahid',&lt;br&gt;
  lastName: 'Iqbal'&lt;br&gt;
}&lt;br&gt;
function greet(greeting, message) {&lt;br&gt;
  return &lt;code&gt;${greeting} ${this.firstName} ${this.lastName}. ${message}&lt;/code&gt;;&lt;br&gt;
}&lt;br&gt;
let result =greet.𝗮𝗽𝗽𝗹𝘆(person, ['Hello', 'How are you?']);&lt;/p&gt;

&lt;p&gt;console.log(result);&lt;br&gt;
// expected output: "Hello Jahid Iqbal. How are you?"&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>𝐃𝐢𝐟𝐟𝐞𝐫𝐞𝐧𝐜𝐞 𝐛𝐞𝐭𝐰𝐞𝐞𝐧 𝐝𝐨𝐮𝐛𝐥𝐞 𝐞𝐪𝐮𝐚𝐥𝐬 == 𝐚𝐧𝐝 𝐭𝐫𝐢𝐩𝐥𝐞 𝐞𝐪𝐮𝐚𝐥𝐬 === 𝐢𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭?</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Tue, 22 Mar 2022 19:06:46 +0000</pubDate>
      <link>https://dev.to/hrid620/--49ck</link>
      <guid>https://dev.to/hrid620/--49ck</guid>
      <description>&lt;p&gt;Double equals== is used for 𝑐𝑜𝑚𝑝𝑎𝑟𝑖𝑛𝑔 𝑡𝑤𝑜 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠, but it 𝑖𝑔𝑛𝑜𝑟𝑒𝑠 the variable's datatype  whereas Triple equals=== is used for comparing two variables, but this operator 𝑎𝑙𝑠𝑜 𝑐ℎ𝑒𝑐𝑘𝑠 𝑑𝑎𝑡𝑎𝑡𝑦𝑝𝑒.&lt;/p&gt;

&lt;p&gt;== returns true only if the two operands are 𝑒𝑞𝑢𝑎𝑙 while === returns true only if two variables 𝑣𝑎𝑙𝑢𝑒𝑠 and 𝑑𝑎𝑡𝑎 𝑡𝑦𝑝𝑒𝑠 are the 𝑠𝑎𝑚𝑒.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>javascriptdeveloper</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CSS position absolute versus relative easy way!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Sun, 30 Jan 2022 17:17:09 +0000</pubDate>
      <link>https://dev.to/hrid620/css-position-absolute-versus-relative-easy-way-4964</link>
      <guid>https://dev.to/hrid620/css-position-absolute-versus-relative-easy-way-4964</guid>
      <description>&lt;p&gt;&lt;strong&gt;CSS position property&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CSS position property determines the positioning of an element and also plays an important role of how the element will be displayed in the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Absolute position&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In absolute position, an element changes the positions and layout with respect to its parent. If it didn’t find any parent then it will use the document body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relative position&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Relative position, an element changes its position within its current position without affecting the layout.&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>CRUD OPERATION IS EASY PEASY IF YOU READ THIS!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Thu, 23 Dec 2021 17:06:52 +0000</pubDate>
      <link>https://dev.to/hrid620/crud-operation-is-easy-peasy-if-you-read-this-o2p</link>
      <guid>https://dev.to/hrid620/crud-operation-is-easy-peasy-if-you-read-this-o2p</guid>
      <description>&lt;p&gt;&lt;strong&gt;CRUD operation&lt;/strong&gt; refers to &lt;em&gt;creating,reading,updating&lt;/em&gt; and &lt;em&gt;deleting&lt;/em&gt; documents in MongoDB.The term &lt;strong&gt;CRUD&lt;/strong&gt; refers to the functions that users need in order to create and manage data.&lt;br&gt;
It makes application design easier and more scalable by simplifying and facilitating it&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Operations
&lt;/h2&gt;

&lt;p&gt;Create or insert operations are used to  insert or add new documents in the collection.If there’s no collection,then it will create a new collection.&lt;/p&gt;

&lt;p&gt;Create operation follow two methods to insert documents into a collection.First method is &lt;em&gt;db.collection.insertOne()&lt;/em&gt; and the second one is &lt;em&gt;db.collection.insertMany()&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;em&gt;db.collection.insertOne()&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to insert a single document in the collection.The document we want to insert is always written inside the insertOne function in a JSON format enclosed inside curly brackets. This is how (below example) we insert one document inside a collection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;db.collection-name.insertOne&lt;/em&gt;(&lt;br&gt;
{&lt;br&gt;
person : 3,&lt;br&gt;
car : 4,&lt;br&gt;
}&lt;br&gt;
)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;db.collection.insertMany()&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to insert multiple documents in the collection.If we want to insert more than one document at a time, we have to use insertMany.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;db.cars.insertMany([{&lt;br&gt;
       name: "Rolex"&lt;br&gt;
       model: "2005"&lt;br&gt;
},{&lt;br&gt;
       name: "G-shock"&lt;br&gt;
       model: "2018"&lt;br&gt;
}])&lt;/p&gt;

&lt;h2&gt;
  
  
  Read Operations
&lt;/h2&gt;

&lt;p&gt;Read operations are used to retrieve documents from the collection or query a collection for documents.The  db.collection.find() operation will return everything from a collection if we call it without any parameters.We can also choose any filter or criteria to obtain data from a collection by using db.collection.find(query)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;db.cars.&lt;em&gt;find() // no parameters&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{ "_id" : ObjectId("1"), "name" : "Asus laptop", "model" : "2005" }&lt;br&gt;
{ "_id" : ObjectId("2"), "name" : "HP laptop", "model" : "2018" }&lt;br&gt;
{ "_id" : ObjectId("3"), "name" : "Dell laptop", "2013" : "2005" }&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;db.cars.&lt;em&gt;find({"model": "2005"}) // with one parameter&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{ "_id" : ObjectId("1"), "name" : "Asus laptop", "model" : "2005"}&lt;/p&gt;

&lt;h2&gt;
  
  
  Update Operations
&lt;/h2&gt;

&lt;p&gt;Update operations are used to update or change the existing document in the collection.&lt;br&gt;
Three ways &lt;em&gt;db.collection.updateOne(), db.collection.updateMany() , db.collection.replaceOne()&lt;/em&gt; to update documents of a collection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;em&gt;db.collection.updateOne()&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to update a single document in the collection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;updateOne&lt;/em&gt;({"_id" : ObjectId("1")}, {$set: { "new_model" : 2020}})&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{"_id" : ObjectId("1"),&lt;br&gt;
   "model" : 2005,&lt;br&gt;
   "new_model" : 2020}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;db.collection.updateMany()&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to update multiple documents in the collection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;updateMany&lt;/em&gt;({"_id" : ObjectId("1")}, {$set: { "name" : "laxy"}, $set: { "new_model" : 2020}})&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{"_id" : ObjectId("1"),&lt;br&gt;
   "model" : 2005,&lt;br&gt;
   "new_model" : 2020&lt;br&gt;
   "name" : "laxy"}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;em&gt;db.collection.replaceOne()&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to replace a single document in the collection .&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
   "_id" : ObjectId("1"),&lt;br&gt;
   "model" : 2005&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;em&gt;replaceOne&lt;/em&gt;({"_id" : ObjectId("1")}, { "new_model" : 2020})&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;{ "_id" : ObjectId("1"),&lt;br&gt;
   "new_model" : 2020&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  Delete Operations
&lt;/h2&gt;

&lt;p&gt;The delete operation is used to delete or eliminate the documents from a collection.&lt;br&gt;
There are two methods to delete documents of a collection.One is &lt;em&gt;db.collection.deleteOne() _and another one is _db.collection.deleteMany()&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;deleteOne()&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to delete a single document from the collection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;db.cars.&lt;em&gt;deleteOne&lt;/em&gt;(&lt;br&gt;
//deletes one laptop having model "2013"&lt;br&gt;
    { "model": "2013" }&lt;br&gt;
)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;deleteMany&lt;/em&gt;()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is used to delete multiple documents from the collection.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;db.cars.&lt;em&gt;deleteMany&lt;/em&gt;(&lt;br&gt;
//delete all cars having model "2013"&lt;br&gt;
    { "model": "2013" }&lt;br&gt;
)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Important topic of React that you can’t Ignore!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Thu, 23 Dec 2021 06:09:47 +0000</pubDate>
      <link>https://dev.to/hrid620/important-topic-of-react-that-you-cant-ignore-57an</link>
      <guid>https://dev.to/hrid620/important-topic-of-react-that-you-cant-ignore-57an</guid>
      <description>&lt;p&gt;&lt;strong&gt;PropTypes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PropTypes is an Internal mechanism of react for adding type checking to components.This mechanism also ensures that the component uses the correct data type and passes the right data in different forms like numbers, strings, arrays, functions, objects, etc.It is also one of the good way to validate the data we get as props by using propTypes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;class MyApp extends React.Component {&lt;br&gt;
render() {&lt;br&gt;
return {&lt;br&gt;
Some value: { this.props.value }&lt;br&gt;
} }}&lt;br&gt;
// Add proptype for "value"&lt;br&gt;
MyApp.propTypes = {&lt;br&gt;
value: PropTypes.number&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Props vs State&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Props&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Props are read-only.&lt;br&gt;
Props are immutable.&lt;br&gt;
Props allow you to pass data from one component to other components as an argument.&lt;br&gt;
Props can be accessed by the child component.&lt;br&gt;
Props are used to communicate between components.&lt;br&gt;
Stateless components can have Props.&lt;br&gt;
Props make components reusable.&lt;br&gt;
Props are external and controlled by whatever renders the component.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;State&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;State changes can be asynchronous.&lt;br&gt;
State is mutable.&lt;br&gt;
State holds information about the components.&lt;br&gt;
State cannot be accessed by child components.&lt;br&gt;
States can be used for rendering dynamic changes with the component.&lt;br&gt;
Stateless components cannot have State.&lt;br&gt;
State cannot make components reusable.&lt;br&gt;
The State is internal and controlled by the React Component itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JSX is a Javascript syntax extension which allows us to write html structures code into a javascript code file.It also makes our code simpler so that it can be easily readable.JSX will throw useful errors if HTML is not correct.&lt;br&gt;
Point to be noted if you are using JSX it will be inside curly braces{ }&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;const element = (&lt;br&gt;
Hello!&lt;br&gt;
Good to see you here.&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component Lifecycle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A react component through goes four stages in its lifecycle which are given below:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mounting=In this phase where a component has been created and inserted into a dom.&lt;br&gt;
Updating=It will be called when a component re-rendered as a result of changes to state or props.&lt;br&gt;
Unmounting=When a component is being removed from dom.&lt;br&gt;
Error handling=It will be called when errors occur during rendering in the lifecycle or in the constructor of the child component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hooks are useful features of react which allow us to use state and other features of react like lifecycle method ,without writing the class.Basically it will not work inside components.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;useState,useEffect are some of the examples of hooks.&lt;/p&gt;

&lt;p&gt;You can create your own and can reuse stateful behaviour to other components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;custom hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The purpose of a custom hook is that it can call other hooks and allow us to have cleaner functional components so that it prevents code duplication by bringing common use cases .We can create this hook ,share logic and data with other components by reusing it.’use’ keyword should be introduced before it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;: useContext&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;context API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context API is a system where data passes directly from parent components to child without having to pass data down manually at every level.When a child component requires data, the Provider component sends it to the child component at any level.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;import ColorContext from './ColorContext';&lt;br&gt;
function App() {&lt;br&gt;
const color= "white";&lt;br&gt;
return (&lt;br&gt;
logo&lt;br&gt;
Welcome to my web page&lt;br&gt;
);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Application Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We can optimize react js application in different ways:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Using React.memo boost the app as it is a higher order component.&lt;br&gt;
Using keys of each component will help us to avoid re-renders.&lt;br&gt;
Need to pass objects as properties so that no unintentional re-renders will happen.&lt;br&gt;
It would be ideal not to make changes in Dom tree structure.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Important topic of React that you can’t Ignore!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Wed, 22 Dec 2021 17:42:19 +0000</pubDate>
      <link>https://dev.to/hrid620/fdfd-27e5</link>
      <guid>https://dev.to/hrid620/fdfd-27e5</guid>
      <description>&lt;p&gt;&lt;strong&gt;PropTypes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PropTypes is an Internal mechanism of react for adding type checking to components.This mechanism also ensures that  the component uses the correct data type and passes the right data in different forms like numbers, strings, arrays, functions, objects, etc.It is  also one of the good way to validate the data we get as props by using propTypes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;class MyApp extends React.Component {&lt;br&gt;
   render() {&lt;br&gt;
       return {&lt;br&gt;
           &lt;/p&gt;
&lt;h1&gt;Some value: {this.props.value}&lt;/h1&gt;
&lt;br&gt;
       } }}&lt;br&gt;
// Add proptype for "value"&lt;br&gt;
MyApp.propTypes = {&lt;br&gt;
   value: PropTypes.number&lt;br&gt;
};

&lt;p&gt;&lt;strong&gt;Props vs State&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Props&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Props are read-only.
&lt;/li&gt;
&lt;li&gt;Props are immutable.&lt;/li&gt;
&lt;li&gt;Props allow you to pass data from one component to other components as an argument.&lt;/li&gt;
&lt;li&gt;Props can be accessed by the child component.&lt;/li&gt;
&lt;li&gt;Props are used to communicate between components.&lt;/li&gt;
&lt;li&gt;Stateless components can have Props.&lt;/li&gt;
&lt;li&gt;Props make components reusable.&lt;/li&gt;
&lt;li&gt;Props are external and controlled by whatever renders the component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;State&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State changes can be asynchronous.&lt;/li&gt;
&lt;li&gt;State is mutable.&lt;/li&gt;
&lt;li&gt;State holds information about the components.&lt;/li&gt;
&lt;li&gt;State cannot be accessed by child components.&lt;/li&gt;
&lt;li&gt;States can be used for rendering dynamic changes with the component.&lt;/li&gt;
&lt;li&gt;Stateless components cannot have State.&lt;/li&gt;
&lt;li&gt;State cannot make components reusable.&lt;/li&gt;
&lt;li&gt;The State is internal and controlled by the React Component itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JSX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JSX is a Javascript syntax extension which allows us to write html structures code into a javascript code file.It also makes our code simpler so that it can be easily readable.JSX will throw useful errors if HTML is not correct.&lt;br&gt;
Point to be noted if you are using JSX it will be inside curly braces{ } &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;const element = (&lt;br&gt;
  &lt;/p&gt;
&lt;br&gt;
    &lt;h1&gt;Hello!&lt;/h1&gt;
&lt;br&gt;
    &lt;h2&gt;Good to see you here.&lt;/h2&gt;
&lt;br&gt;
  &lt;br&gt;
);

&lt;p&gt;&lt;strong&gt;Component Lifecycle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A react component through goes four stages in its lifecycle which are given below:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mounting=In this phase where a component has been created and inserted into a dom.&lt;/li&gt;
&lt;li&gt;Updating=It will be called when a component re-rendered as a result of changes to state            or props.&lt;/li&gt;
&lt;li&gt;Unmounting=When a component is being removed from dom.&lt;/li&gt;
&lt;li&gt;Error handling=It will  be called when errors occur during rendering in the lifecycle or in the constructor of the child component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hooks are useful features of react which allow us to use state and other features of react like lifecycle method ,without writing the class.Basically it will not work inside components.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;useState,useEffect are some of the examples of hooks.&lt;/p&gt;

&lt;p&gt;You can create your own and can reuse stateful behaviour to other components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;custom hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The purpose of a custom hook is that it can call other hooks and allow us to have cleaner functional components so that it prevents code duplication by bringing common use cases .We can create this hook ,share logic and data with other components by reusing it.’use’ keyword should be introduced before it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;: useContext &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;context API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context API is a system where data passes directly from parent components to child without having to pass data down manually at every level.When a child component requires data, the Provider component sends it to the child component at any level.&lt;/p&gt;

&lt;p&gt;_Example&lt;br&gt;
_&lt;br&gt;
import ColorContext from './ColorContext';&lt;br&gt;
    function App() {&lt;br&gt;
      const color= "white";&lt;br&gt;
      return (&lt;br&gt;
        &lt;br&gt;
            &lt;br&gt;
            &lt;br&gt;
              &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DSptEEx6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/%7Blogo%7D" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DSptEEx6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/%7Blogo%7D" alt="logo" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
              &lt;/p&gt;
&lt;h1&gt;Welcome to my web page&lt;/h1&gt;
&lt;br&gt;
              &lt;br&gt;
                &lt;br&gt;
          &lt;br&gt;
      );&lt;br&gt;
    }

&lt;p&gt;&lt;strong&gt;React Application Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We can optimize react js application in different ways:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using React.memo boost the app as it is a higher order component.&lt;/li&gt;
&lt;li&gt;Using keys of each  component will help us to avoid re-renders.&lt;/li&gt;
&lt;li&gt;Need to pass objects as properties so that no unintentional re-renders will happen.&lt;/li&gt;
&lt;li&gt;It would be ideal not to make changes in Dom tree structure.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Some Important JavaScript concepts you must know!!</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Tue, 21 Dec 2021 17:56:02 +0000</pubDate>
      <link>https://dev.to/hrid620/some-important-javascript-concepts-you-must-know-hng</link>
      <guid>https://dev.to/hrid620/some-important-javascript-concepts-you-must-know-hng</guid>
      <description>&lt;p&gt;&lt;strong&gt;Differences between “==” and “===”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Double equal (==) checks only the value equality and also converts the value into the same type, whereas triple-equal (===)  strictly checks value equality and also it does not convert the value into the same type. If a variable's value is same but their type is different then it will return false.&lt;/p&gt;

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

&lt;p&gt;'1' == 1    =&amp;gt;  true&lt;/p&gt;

&lt;p&gt;1 === '1'   =&amp;gt;  false&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Truthy and Falsy values&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Truthy values&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;true&lt;br&gt;
Any number (positive or negative)&lt;br&gt;
Any string including white space , ‘o’ ,’false’&lt;br&gt;
[ ] ,{ }&lt;br&gt;
Anything else that is not falsy will be truthy&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Falsy values&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;false&lt;br&gt;
0&lt;br&gt;
Empty string&lt;br&gt;
undefined,null&lt;br&gt;
NaN&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recursion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recursive is a function that can call itself.It can solve any problem just by calling itself. As it calls itself , it can become infinity, so to stop it from becoming infinity we need to set a terminator point . When it hits a terminator point, it will be terminated and the recursive function will stop there, which means it will return .&lt;/p&gt;

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

&lt;p&gt;function countDownFrom(number) {&lt;br&gt;
    if (number === 0) {&lt;br&gt;
        return;&lt;br&gt;
    }&lt;br&gt;
    console.log(number);&lt;br&gt;&lt;br&gt;
    countDownFrom(number - 1);&lt;br&gt;
}&lt;br&gt;
countDownFrom(5);&lt;br&gt;
// 5&lt;br&gt;
// 4&lt;br&gt;
// 3&lt;br&gt;
// 2&lt;br&gt;
// 1&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Javascript,the availability or usability of a variable or other resource in our code is defined by its scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Block Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a variable is declared inside { } curly brackets or block  and cannot  be accessed  from this block then it is known as Block scope.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;var x = 1;&lt;br&gt;
let y = 1;&lt;/p&gt;

&lt;p&gt;if (true) {&lt;br&gt;
  var x = 2;&lt;br&gt;
  let y = 2;}&lt;br&gt;
console.log(x);&lt;br&gt;
// expected output: 2&lt;/p&gt;

&lt;p&gt;console.log(y);&lt;br&gt;
// expected output: 1&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global Variable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A variable which has been declared outside the function and can be accessed from anywhere  globally then it is known as Global Variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global Scope&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;A Scope which refers to all the variables declared in a JS file that aren't even inside any function and also it’s variables can be accessed from anywhere in the file.This type of scope is known as Global scope.&lt;/p&gt;

&lt;p&gt;myVar = 1; // An automatic global variable&lt;/p&gt;

&lt;p&gt;// An automatic global function&lt;br&gt;
function myFunc() {&lt;br&gt;
    return true;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Window&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is very useful for browsers when a user wants to go forward,backward,an existing page and another page, then it can easily go with the help of a window object.&lt;/p&gt;

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

&lt;p&gt;window.open() - open a new window&lt;br&gt;
window.close() - close the current window&lt;br&gt;
window.moveTo() - move the current window&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Closure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In closure,an outside function can run the inner function and the inner function can still access variables used by the outer one.&lt;br&gt;
It will be very useful when we will create private variables and functions to hide implementation details in javascript.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;function init() {&lt;br&gt;
  var name = 'Mozilla'; // name is a local variable created by init&lt;br&gt;
  function displayName() { // displayName() is the inner function, a closure&lt;br&gt;
    alert(name); // use variable declared in the parent function&lt;br&gt;
  }&lt;br&gt;
  displayName();&lt;br&gt;
}&lt;br&gt;
init();&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encapsulation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A mechanism which restricts direct access to some of the object’s component.At the same it also bundles data with methods that can operate on that data.&lt;/p&gt;

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

&lt;p&gt;var employee = {&lt;br&gt;
name : "Aditya Chaturvedi",&lt;br&gt;
};&lt;br&gt;
alert(employee.name); // Aditya Chaturvedi&lt;br&gt;
employee.name = "Rahul Khanna";&lt;br&gt;
alert(employee.name); // Rahul Khanna&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bind()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bind() method returns a new function.It also helps us to bind multiple objects to a new function.it’s ‘this’ keyword which allows us to add new parameters in bind().&lt;/p&gt;

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

&lt;p&gt;const module = {&lt;br&gt;
  x: 42,&lt;br&gt;
  getX: function() {&lt;br&gt;
    return this.x;&lt;br&gt;
  }&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;const unboundGetX = module.getX;&lt;br&gt;
console.log(unboundGetX()); // The function gets invoked at the global scope&lt;br&gt;
// expected output: undefined&lt;/p&gt;

&lt;p&gt;const boundGetX = unboundGetX.bind(module);&lt;br&gt;
console.log(boundGetX());&lt;br&gt;
// expected output: 42&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;call()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method calls  a function whose first parameter will consider the object as ‘this’ value .&lt;br&gt;
It will also take parameters separately. Comma used for separation.&lt;/p&gt;

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

&lt;p&gt;function Product(name, price) {&lt;br&gt;
  this.name = name;&lt;br&gt;
  this.price = price;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function Food(name, price) {&lt;br&gt;
  Product.call(this, name, price);&lt;br&gt;
  this.category = 'food';&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;console.log(new Food('cheese', 5).name);&lt;br&gt;
// expected output: "cheese"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apply()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method calls  a function whose first parameter will consider the object as ‘this’ value.It takes parameters as an array.&lt;/p&gt;

&lt;p&gt;_Example&lt;br&gt;
_&lt;br&gt;
const person = {&lt;br&gt;
    firstName: 'John',&lt;br&gt;
    lastName: 'Doe'&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function greet(greeting, message) {&lt;br&gt;
    return &lt;code&gt;${greeting} ${this.firstName}. ${message}&lt;/code&gt;;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let result = greet.apply(person, ['Hello', 'How are you?']);&lt;/p&gt;

&lt;p&gt;console.log(result);&lt;/p&gt;

&lt;p&gt;// expected output: Hello John. How are you?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Easy way to understand JavaScript Array Methods</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Mon, 20 Dec 2021 17:46:25 +0000</pubDate>
      <link>https://dev.to/hrid620/easy-way-to-understand-javascript-array-methods-11b5</link>
      <guid>https://dev.to/hrid620/easy-way-to-understand-javascript-array-methods-11b5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Concat()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Concat method   does not change the main array; instead, it combines multiple arrays and returns a new array.&lt;/p&gt;

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

&lt;p&gt;const array1 = ['a', 'b', 'c'];&lt;br&gt;
const array2 = ['d', 'e', 'f'];&lt;br&gt;
const array3 = array 1.concat(array2);&lt;/p&gt;

&lt;p&gt;console.log(array3);&lt;br&gt;
// expected output: Array ["a", "b", "c", "d", "e", "f"]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;every()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;every method checks if all the elements of the  array fulfil the condition,which is provided by a method passed to it as an argument.It returns a Boolean value(true/false)&lt;/p&gt;

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

&lt;p&gt;const isBelowThreshold = (currentValue) =&amp;gt; currentValue &amp;lt; 40;&lt;/p&gt;

&lt;p&gt;const array1 = [1, 30, 39, 29, 10, 13];&lt;/p&gt;

&lt;p&gt;console.log(array1.every(isBelowThreshold));&lt;br&gt;
// expected output: true&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;filter()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The filter method returns a new array that fulfills a condition given by a function.It doesn’t change the original array.&lt;/p&gt;

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

&lt;p&gt;const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];&lt;/p&gt;

&lt;p&gt;const result = words.filter(word =&amp;gt; word.length &amp;gt; 6);&lt;/p&gt;

&lt;p&gt;console.log(result);&lt;br&gt;
// expected output: Array ["exuberant", "destruction", "present"]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;find()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The find method returns the value of the first element in the array that fulfills the condition given by a function. If no values satisfy the condition of a function then undefined will be returned.&lt;/p&gt;

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

&lt;p&gt;const array1 = [5, 12, 8, 130, 44];&lt;/p&gt;

&lt;p&gt;const found = array1.find(element =&amp;gt; element &amp;gt; 10);&lt;/p&gt;

&lt;p&gt;console.log(found);&lt;br&gt;
// expected output: 12&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;findIndex()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;findIndex() method  is very much similar to find(). The  difference is that  it returns the index(position) of the first element that satisfies the condition.If it didn’t match any condition then it will return  -1.&lt;/p&gt;

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

&lt;p&gt;const array1 = [5, 12, 8, 130, 44];&lt;/p&gt;

&lt;p&gt;const isLargeNumber = (element) =&amp;gt; element &amp;gt; 13;&lt;/p&gt;

&lt;p&gt;console.log(array1.findIndex(isLargeNumber));&lt;br&gt;
// expected output: 3 (130)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;forEach()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The forEach() method calls the provided function once for each array element.&lt;/p&gt;

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

&lt;p&gt;const array1 = ['ami', 'bami', 'cami'];&lt;/p&gt;

&lt;p&gt;array1.forEach(element =&amp;gt; console.log(element));&lt;/p&gt;

&lt;p&gt;// expected output: "'ami"&lt;br&gt;
// expected output: "bami"&lt;br&gt;
// expected output: "cami"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;indexOf()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The indexOf() method returns the first index (position) in the array  where a given element can be found .&lt;br&gt;
If it doesn't find any value then it will return -1.Another important thing is that indexOf searches(left to right) from the first.&lt;/p&gt;

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

&lt;p&gt;const beasts = ['mala', 'gala', 'tala', ‘rala', 'bala'];&lt;/p&gt;

&lt;p&gt;console.log(beasts.indexOf('gala'));&lt;br&gt;
// expected output: 1&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;lastIndexOf()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The lastIndexOf() method returns the last index (position) in the array  where a given element can be found .If it doesn't find any value then it will return -1.Another important thing is that lastIndexOf  searches(right to left.) from the last.&lt;/p&gt;

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

&lt;p&gt;const beasts = ['mala', 'gala', 'tala', ‘rala', 'bala'];&lt;/p&gt;

&lt;p&gt;console.log(beasts.lastIndexOf('bala'));&lt;br&gt;
// expected output: 4&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;join()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The join method concatenates all of the elements in an array and then returns a new string separated by commas or a specified separator string.If there is only one element in an array then it will be returned without using the separator.&lt;/p&gt;

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

&lt;p&gt;const elements = ['Fire', 'Air', 'Water'];&lt;/p&gt;

&lt;p&gt;console.log(elements.join());&lt;br&gt;
// expected output: "Fire,Air,Water"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;map()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;map() method returns  a new array by calling a function for every array element.&lt;/p&gt;

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

&lt;p&gt;const array1 = [1, 4, 9, 16];&lt;/p&gt;

&lt;p&gt;// pass a function to map&lt;br&gt;
const map1 = array1.map(x =&amp;gt; x * 2);&lt;/p&gt;

&lt;p&gt;console.log(map1);&lt;br&gt;
// expected output: Array [2, 8, 18, 32]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;shift()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;shift() method removes an element from the beginning of an array.&lt;/p&gt;

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

&lt;p&gt;const array1 = [1, 2, 3];&lt;/p&gt;

&lt;p&gt;const firstElement = array1.shift();&lt;/p&gt;

&lt;p&gt;console.log(array1);&lt;br&gt;
// expected output: Array [2, 3]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pop()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pop() method removes an element from the end of an array.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];&lt;/p&gt;

&lt;p&gt;console.log(plants.pop());&lt;br&gt;
// expected output: "tomato"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unshift()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The unshift() method add element to the beginning of an array.&lt;/p&gt;

&lt;p&gt;const array1 = [1, 2, 3];&lt;/p&gt;

&lt;p&gt;console.log(array1.unshift(4, 5));&lt;br&gt;
// expected output: 5&lt;/p&gt;

&lt;p&gt;console.log(array1);&lt;br&gt;
// expected output: Array [4, 5, 1, 2, 3]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;push()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;push() method add element to the end of an array.&lt;/p&gt;

&lt;p&gt;const animals = ['pigs', 'goats', 'sheep'];&lt;/p&gt;

&lt;p&gt;const count = animals.push('cows');&lt;br&gt;
console.log(count);&lt;br&gt;
// expected output: 4&lt;br&gt;
console.log(animals);&lt;br&gt;
// expected output: Array ["pigs", "goats", "sheep", "cows"]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Tips to make website responsive !</title>
      <dc:creator>Jahid Iqbal</dc:creator>
      <pubDate>Sun, 19 Dec 2021 17:11:49 +0000</pubDate>
      <link>https://dev.to/hrid620/tips-to-make-website-responsive--3kn7</link>
      <guid>https://dev.to/hrid620/tips-to-make-website-responsive--3kn7</guid>
      <description>&lt;p&gt;A website's responsive design is very crucial. No matter how great your website's user interface is, if it doesn't fit on every screen, from large to small, it will lose its significance.&lt;br&gt;
So there will be a lot of basic things that I will cover in this blog so that you don't have to worry about responsiveness.&lt;/p&gt;

&lt;p&gt;Flexbox&lt;/p&gt;

&lt;p&gt;When you are struggling with responsiveness. Flexbox solves many difficult problems. Because it has a one-dimensional layout, it works only in one direction. Basically, it works with your web content. Some examples are given below how it works in column and rows in website.&lt;/p&gt;

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

&lt;p&gt;If you work with flex rows responsive ,then set the width of left and right to 50%, center to 100% and then declare "flex-flow: row wrap;" on the container.&lt;/p&gt;

&lt;p&gt;Meanwhile, if you work with flex column responsive ,screens that are 992px wide or less, the columns will then transform it’s size from  four columns to two columns. At the same, The column will be on top of another rather than close to each other in 600px wide or less.&lt;/p&gt;

&lt;p&gt;Grid system&lt;/p&gt;

&lt;p&gt;Grid  will change its layout according to the size of the screen. It will adjust itself to any screen. It is very suitable for large scale layout as it can control two dimensional layout both on rows and columns. Grid layout also help you to write less code than media queries and it is also easier to apply.&lt;/p&gt;

&lt;p&gt;You can use display: grid to use grid in your container.&lt;/p&gt;

&lt;p&gt;Based on row and column you need to declare grid-template-rows and grid-template-columns in CSS.&lt;/p&gt;

&lt;p&gt;You can also give a gap between rows and columns by declaring grid-column-gap and grid-row-gap.&lt;/p&gt;

&lt;p&gt;Bonus Tip&lt;/p&gt;

&lt;p&gt;100% and Block&lt;/p&gt;

&lt;p&gt;To make any div and section responsive in a small screen you can use Width 100% and block. But be careful it is not appropriate in every situation.&lt;/p&gt;

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