<?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: Bilal Niaz </title>
    <description>The latest articles on DEV Community by Bilal Niaz  (@bilalniaz15).</description>
    <link>https://dev.to/bilalniaz15</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%2F799883%2F29e7ad82-12ba-49ee-b50f-5f7e3892671b.png</url>
      <title>DEV Community: Bilal Niaz </title>
      <link>https://dev.to/bilalniaz15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bilalniaz15"/>
    <language>en</language>
    <item>
      <title>Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Mon, 19 Jan 2026 11:14:33 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/error-prismaclient-did-not-initialize-yet-please-run-prisma-generate-and-try-to-import-it-247i</link>
      <guid>https://dev.to/bilalniaz15/error-prismaclient-did-not-initialize-yet-please-run-prisma-generate-and-try-to-import-it-247i</guid>
      <description>&lt;p&gt;This error is very common with Prisma, and it means the Prisma Client was not generated&lt;/p&gt;

&lt;p&gt;First, check if both required Prisma packages are properly installed in your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm ls @prisma/client prisma
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see both packages listed. If either is missing, install them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @prisma/client
npm install prisma --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why both packages?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;@prisma/client - The runtime client you import in your code&lt;/li&gt;
&lt;li&gt;Prisma: The CLI tool used for migrations and generating the client&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prisma requires a schema file at a specific location. Check that you have a file at:&lt;/p&gt;

&lt;p&gt;your-project/&lt;br&gt;
├── prisma/&lt;br&gt;
│   └── schema.prisma&lt;br&gt;
├── node_modules/&lt;br&gt;
├── package.json&lt;br&gt;
└── index.js&lt;/p&gt;

&lt;p&gt;Your schema.prisma file must contain the client generator configuration:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;generator client {&lt;br&gt;
  provider = "prisma-client-js"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you don't have this file, initialize Prisma:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run migration (recommended).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma migrate dev --name init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where many developers make mistakes. Ensure you're importing Prisma Client correctly in your code&lt;/p&gt;

&lt;p&gt;Correct:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const { PrismaClient } = require('@prisma/client');&lt;br&gt;
const prisma = new PrismaClient();&lt;/code&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>express</category>
    </item>
    <item>
      <title>How to install Prisma in express.js</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Mon, 19 Jan 2026 11:01:21 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/install-prisma-expressjs-guide-a1e</link>
      <guid>https://dev.to/bilalniaz15/install-prisma-expressjs-guide-a1e</guid>
      <description>&lt;p&gt;Before we install Prisma in Express.js. Let's explain what Express.js and Prisma are.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Express&lt;/strong&gt; is a popular, free, open-source, and minimalist web application framework for Node.js. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prisma&lt;/strong&gt; is a modern, open-source database toolkit for Node.js and TypeScript that simplifies database interactions by providing a type-safe, object-oriented API, replacing raw SQL with intuitive code for tasks like CRUD operations. It features a powerful ORM (Object-Relational Mapper) for easy data modeling, a migration system (Prisma Migrate), and a GUI for database inspection (Prisma Studio). It supports various databases (PostgreSQL, MySQL, MongoDB, etc.) and ensures type safety, catching errors at compile time, making development faster and more reliable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites for Installing Prisma ORM&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js (version 16.13.0 or higher)&lt;/li&gt;
&lt;li&gt;npm or yarn package manager&lt;/li&gt;
&lt;li&gt;A basic Express.js application setup&lt;/li&gt;
&lt;li&gt;A database (PostgreSQL, MySQL, SQLite, MongoDB, or SQL Server)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Set Up Your Express.js Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you haven't created an Express.js project yet, initialize one with these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir express-prisma-app
cd express-prisma-app
npm init -y
npm install express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a basic Express server in index.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express');
const app = express();
const PORT = 3000;

app.use(express.json());

app.get('/', (req, res) =&amp;gt; {
  res.json({ message: 'Express server with Prisma ORM' });
});

app.listen(PORT, () =&amp;gt; {
  console.log(`Server running on port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Install Prisma ORM Dependencies&lt;/strong&gt;&lt;br&gt;
Install Prisma CLI as a development dependency and Prisma Client as a regular dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install prisma --save-dev
npm install @prisma/client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For TypeScript projects, also install type definitions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install typescript ts-node @types/node @types/express --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Initialize Prisma in Your Express Application&lt;/strong&gt;&lt;br&gt;
Run the Prisma initialization command to create the necessary configuration files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A prisma directory with a schema.prisma file&lt;/li&gt;
&lt;li&gt;A .env file for your database connection string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Configure Your Database Connection&lt;/strong&gt;&lt;br&gt;
Open the .env file and add your database connection URL. Here are examples for different databases:&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABASE_URL="postgresql://username:password@localhost:5432/mydb?schema=public"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABASE_URL="mysql://username:password@localhost:3306/mydb"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABASE_URL="file:./dev.db"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DATABASE_URL="mongodb+srv://username:password@cluster.mongodb.net/mydb"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Define Your Prisma Schema&lt;/strong&gt;&lt;br&gt;
Edit the prisma/schema.prisma file to define your database models. Here's an example schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"  // Change to your database
  url      = env("DATABASE_URL")
}

model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  posts     Post[]
  createdAt DateTime @default(now())
}

model Post {
  id        Int      @id @default(autoincrement())
  title     String
  content   String?
  published Boolean  @default(false)
  author    User     @relation(fields: [authorId], references: [id])
  authorId  Int
  createdAt DateTime @default(now())
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6: Run Prisma Migrations&lt;/strong&gt;&lt;br&gt;
Create and apply your database migrations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma migrate dev --name init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates SQL migration files&lt;/li&gt;
&lt;li&gt;Applies migrations to your database&lt;/li&gt;
&lt;li&gt;Generates the Prisma Client&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Generate Prisma Client&lt;/strong&gt;&lt;br&gt;
If you need to regenerate the Prisma Client after schema changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 8: Integrate Prisma Client with Express.js&lt;/strong&gt;&lt;br&gt;
Create a prisma.js file to instantiate the Prisma Client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { PrismaClient } = require('@prisma/client');

const prisma = new PrismaClient();

module.exports = prisma;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 9: Use Prisma in Express Routes&lt;/strong&gt;&lt;br&gt;
Update your Express application to use Prisma for database operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express');
const prisma = require('./prisma');

const app = express();
app.use(express.json());

// Create a new user
app.post('/users', async (req, res) =&amp;gt; {
  try {
    const { email, name } = req.body;
    const user = await prisma.user.create({
      data: { email, name }
    });
    res.json(user);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

// Get all users
app.get('/users', async (req, res) =&amp;gt; {
  try {
    const users = await prisma.user.findMany({
      include: { posts: true }
    });
    res.json(users);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

// Get user by ID
app.get('/users/:id', async (req, res) =&amp;gt; {
  try {
    const { id } = req.params;
    const user = await prisma.user.findUnique({
      where: { id: Number(id) },
      include: { posts: true }
    });
    res.json(user);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

const PORT = 3000;
app.listen(PORT, () =&amp;gt; {
  console.log(`Express server with Prisma running on port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prisma Studio is a visual database GUI (Graphical User Interface) included with Prisma, allowing developers to easily explore, view, and edit data in their databases directly in a web browser through a user-friendly interface, supporting CRUD operations, filtering, sorting, and visualizing data relationships, accessible locally via&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx prisma studio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Installing Prisma ORM in Express.js enhances your Node.js application with type-safe database queries, automatic migrations, and excellent developer experience. By following this guide, you've successfully integrated Prisma with Express.js and learned how to perform CRUD operations efficiently&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>express</category>
    </item>
    <item>
      <title>What is this in JavaScript?</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Sat, 16 Apr 2022 04:46:00 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/what-is-this-57d6</link>
      <guid>https://dev.to/bilalniaz15/what-is-this-57d6</guid>
      <description>&lt;p&gt;In JavaScript, the this keyword operates a little differently than in other languages. There are also some distinctions between stringent and non-strict modes.&lt;br&gt;
The this keyword refers to different objects depending on how it is used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In an object method, this refers to the object.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alone, this refers to the global object.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In a function, this refers to the global object.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In a function, in strict mode, this is undefined.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In an event, this refers to the element that received the event.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;this in a Method:&lt;/strong&gt;&lt;br&gt;
When used in an object method, this refers to the object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  firstName: "John",
  lastName: "Doe",
  id: 5566,
  fullName : function() {
    return this.firstName + " " + this.lastName;
  }
};
console.log(person.fullName()) //output : John Doe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;this Alone:&lt;/strong&gt;&lt;br&gt;
When used alone, this refers to the global object.&lt;br&gt;
Because this is running in the global scope.&lt;br&gt;
In a browser window the global object is [object Window]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = this;
console.log(x) //output is :[object Window]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In strict mode, when used alone, this also refers to the global object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use strict:";
let x = this;
console.log(x) //output is :[object Window]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;this in a Function(Default):&lt;/strong&gt;&lt;br&gt;
In a function, the global object is the default binding for this.&lt;br&gt;
In a browser window the global object is [object Window]:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  return this;
}
myFunction() //output is : [object Window]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;this in a Function (Strict):&lt;/strong&gt;&lt;br&gt;
JavaScript strict mode does not allow default binding.&lt;br&gt;
So, when used in a function, in strict mode, this is undefined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use strict";
function myFunction() {
  return this;
}
myFunction() //output is : undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;this in Event Handlers:&lt;/strong&gt;&lt;br&gt;
In HTML event handlers, this refers to the HTML element that received the event:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button onclick="this.style.display='none'"&amp;gt;
  Click to Remove Me!
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>PHP Data Types:</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Mon, 04 Apr 2022 06:58:57 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/php-data-types-f5b</link>
      <guid>https://dev.to/bilalniaz15/php-data-types-f5b</guid>
      <description>&lt;p&gt;&lt;strong&gt;PHP Data Types:&lt;/strong&gt;&lt;br&gt;
Variables can store data of different types, and different data types can do different things.&lt;br&gt;
PHP supports the following data types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Integer&lt;/li&gt;
&lt;li&gt;Float (floating point numbers - also called double)&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Array&lt;/li&gt;
&lt;li&gt;Object&lt;/li&gt;
&lt;li&gt;NULL&lt;/li&gt;
&lt;li&gt;Resource
&lt;strong&gt;PHP String:&lt;/strong&gt;
A string is a sequence of characters, like "Hello world!".
A string can be any text inside quotes. You can use single or double quotes:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$x = "Hello world!";
$y = 'Hello world!';

echo $x;
echo "&amp;lt;br&amp;gt;";
echo $y;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;PHP Integer:&lt;/strong&gt;&lt;br&gt;
  An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647.&lt;br&gt;
Rules of integer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An integer must have at least one digit&lt;/li&gt;
&lt;li&gt;An integer must not have a decimal point&lt;/li&gt;
&lt;li&gt;An integer can be either positive or negative&lt;/li&gt;
&lt;li&gt;Integers can be specified in: decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2) notation.
In the following example $x is an integer. The PHP var_dump() function returns the data type and value:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$x = 5985;
var_dump($x);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;PHP Float:&lt;/strong&gt;&lt;br&gt;
A float (floating point number) is a number with a decimal point or a number in exponential form.&lt;br&gt;
In the following example $x is a float. The PHP var_dump() function returns the data type and value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$x = 10.365;
var_dump($x);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PHP Boolean:&lt;/strong&gt;&lt;br&gt;
A Boolean represents two possible states: TRUE or FALSE.&lt;br&gt;
Booleans are often used in conditional testing. You will learn more about conditional testing in a later chapter of this tutorial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$x = true;
$y = false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PHP Array:&lt;/strong&gt;&lt;br&gt;
An array stores multiple values in one single variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$cars = array("Volvo","BMW","Toyota");
var_dump($cars);
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PHP Object:&lt;/strong&gt;&lt;br&gt;
Classes and objects are the two main aspects of object-oriented programming.&lt;br&gt;
A class is a template for objects, and an object is an instance of a class.&lt;br&gt;
When the individual objects are created, they inherit all the properties and behaviors from the class, but each object will have different values for the properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car {
  public $color;
  public $model;
  public function __construct($color, $model) {
    $this-&amp;gt;color = $color;
    $this-&amp;gt;model = $model;
  }
  public function message() {
    return "My car is a " . $this-&amp;gt;color . " " . $this-&amp;gt;model . "!";
  }
}

$myCar = new Car("black", "Volvo");
echo $myCar -&amp;gt; message();
echo "&amp;lt;br&amp;gt;";
$myCar = new Car("red", "Toyota");
echo $myCar -&amp;gt; message();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PHP NULL Value:&lt;/strong&gt;&lt;br&gt;
Null is a special data type which can have only one value: NULL.&lt;br&gt;
A variable of data type NULL is a variable that has no value assigned to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$x = "Hello world!";
$x = null;
var_dump($x);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PHP Resource:&lt;/strong&gt;&lt;br&gt;
The special resource type is not an actual data type. It is the storing of a reference to functions and resources external to PHP.&lt;br&gt;
A common example of using the resource data type is a database call.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Install Laravel on Ubuntu 20.04</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Sat, 26 Mar 2022 13:29:50 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/how-to-install-laravel-on-ubuntu-2004-lts-58hk</link>
      <guid>https://dev.to/bilalniaz15/how-to-install-laravel-on-ubuntu-2004-lts-58hk</guid>
      <description>&lt;p&gt;Laravel is an open-source PHP web framework. It is mainly used for building PHP-based web applications.&lt;/p&gt;

&lt;p&gt;Laravel is suitable for both small-scale and enterprise-level application development. Its elegant syntax, advanced features, robust tools help simplify web application development. Laravel is highly scalable and has built-in support for distributed cache systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install Apache web server:&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; sudo apt install apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, Apache should be running. If it's not, for whatever reason, start it:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then enable it to start on boot time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify the status of Apache, execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo systemctl status apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fpa559fgjsb369y76fii3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fpa559fgjsb369y76fii3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install PHP and additional PHP extensions:&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;sudo apt install php libapache2-mod-php php-mbstring php-cli php-bcmath php-json php-xml php-zip php-pdo php-common php-tokenizer php-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the installation is complete, verify the PHP version.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F9nl4o1vemj3eoekkl0cd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9nl4o1vemj3eoekkl0cd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create Database for Laravel Application:&lt;/strong&gt;&lt;br&gt;
But first, we need to install a database server. Laravel supported database systems are MariaDB, MySQL, SQLite, Postgres, or SQL Server.&lt;br&gt;
We will go with the MariaDB database engine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mariadb-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the database server is installed, log into the MariaDB prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo  mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once logged in create the database, database user, and grant all privileges to the database user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE laravel_db;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE USER 'laravel_user'@'localhost' IDENTIFIED BY 'secretpassword';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GRANT ALL ON laravel_db.* TO 'laravel_user'@'localhost';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Install Composer:&lt;/strong&gt;&lt;br&gt;
Composer is a dependency package manager for PHP. It provides a framework for managing libraries and dependencies and required dependencies. To use Laravel, first install composer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -sS https://getcomposer.org/installer | php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This downloads the composer.phar file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fn1t9ohj8ozz9st6nv67i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fn1t9ohj8ozz9st6nv67i.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Next, move the composer file to the /usr/local/bin path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mv composer.phar  /usr/local/bin/composer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Assign execute permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x   /usr/local/bin/composer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the Composer version installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F7axydnrv6gp06hxhavv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7axydnrv6gp06hxhavv0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Install Laravel 8 on Ubuntu:&lt;/strong&gt;&lt;br&gt;
With Composer installed, the next course of action is to install Laravel.&lt;/p&gt;

&lt;p&gt;Navigate to the webroot directory, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, install Laravel using the composer command, type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo composer create-project laravel/laravel laravelapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command creates a new directory called laravelapp and installs all the files and directories for Laravel.&lt;/p&gt;

&lt;p&gt;Change the ownership of the Laravel directory to the webserver user and also the permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data /var/www/html/laravelapp
sudo chmod -R 775 /var/www/html/laravelapp/storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to replace laravelapp with a preferred directory name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F3na5lz2qfunck29tm878.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F3na5lz2qfunck29tm878.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Once the installation is done navigate to the installation directory and check the Laravel version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd laravelapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F9zx20uawixsqh9beaw46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9zx20uawixsqh9beaw46.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Configure Apache to serve Laravel site:&lt;/strong&gt;&lt;br&gt;
Lastly, we need to set up the Apache webserver to host the Laravel site. For that to happen, we need to create a virtual host file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/apache2/sites-available/laravel.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, past the content shown and replace the example.com ServerName directive with the FQDN or public IP of the server ( Or private IP in case the server is on a LAN network ).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br&gt;
ServerName example.com&lt;br&gt;
ServerAdmin admin@example.com&lt;br&gt;
DocumentRoot /var/www/html/laravelapp/public&lt;br&gt;
&amp;lt;Directory /var/www/html/laravelapp&amp;gt;&lt;br&gt;
AllowOverride All&lt;br&gt;
&amp;lt;/Directory&amp;gt;&lt;br&gt;
ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br&gt;
CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;/code&gt;&lt;br&gt;
Save the changes and exit the file. Next, enable the Laravel site and Apache rewrite module using these two commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo a2ensite laravel.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo a2enmod rewrite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To apply the changes, restart Apache&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Access Laravel from a browser:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fjnm0bb6kww8h7ioqwfsa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjnm0bb6kww8h7ioqwfsa.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Follow Me : &lt;a href="https://twitter.com/Bilalniaz15" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;  &lt;a href="https://www.linkedin.com/in/bilal-niaz-147792214/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>linux</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Interaction in Javascript</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Fri, 18 Mar 2022 09:39:55 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/interaction-in-javascript-34p8</link>
      <guid>https://dev.to/bilalniaz15/interaction-in-javascript-34p8</guid>
      <description>&lt;p&gt;We have the ability to connect with the user and answer appropriately thanks to Javascript. It has a number of user-interface functions that aid interaction. Let's take a look at each one individually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alert:&lt;/strong&gt;&lt;br&gt;
     Simply produces an alert box that may or may not contain the supplied content, but always includes a 'OK' button. It just displays a notice and stops the script from running until you press the 'OK' button. The modal window is the name for the pop-up mini-window.&lt;br&gt;
&lt;code&gt;alert('text');&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// alert example
&amp;lt;script&amp;gt;
 alert('HI there'); // with specified content
 alert(); // without any specified content
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fxyrfhh850kdywfhbbja3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxyrfhh850kdywfhbbja3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can be used for debugging or simply for popping something to the user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;br&gt;
    Prompt is another user-interface function which normally contains two arguments.&lt;br&gt;
&lt;code&gt;prompt('text', default value);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The default value parameter is optional, albeit it functions as a placeholder inside a text field. The text is basically what you want to show the user, and the default value argument is what you want to display the user. It is the most commonly used interface since it allows you to ask the user for input and then use that information to build something.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;script&amp;gt;
// prompt example
let age = prompt('How old are you?', 50);// For default arg 
alert(`You are ${age} years old!`); 
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fifoix06fwgn1xgn9mnvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fifoix06fwgn1xgn9mnvu.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
You can enter anything and it will print that, it doesn’t necessarily have to be a number. Without the default value, you have to enter something in the text-field otherwise it will print a blank space simply.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
// prompt example
let age = prompt('How old are you?');

alert(`You are ${age} years old!`); 
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fvluxaeai6zjb1tyjdrlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvluxaeai6zjb1tyjdrlb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Confirm:&lt;/strong&gt;&lt;br&gt;
     The confirm function basically outputs a modal window with a question and two button ‘OK’ and ‘CANCEL’.&lt;br&gt;
&lt;code&gt;confirm('question');&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
// confirm example 
let isHappy  = confirm('Are you Happy?');
alert(`You are ${isHappy}`); 
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F94n4b43ojwexk72cyeqx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F94n4b43ojwexk72cyeqx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will print true or false based on your choice of clicking the ‘OK’ button or ‘CANCEL’ button respectively.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is the scope and compiler?</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Sun, 13 Mar 2022 11:25:33 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/what-is-the-scope-and-compiler-48p1</link>
      <guid>https://dev.to/bilalniaz15/what-is-the-scope-and-compiler-48p1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Scope:&lt;/strong&gt;&lt;br&gt;
     A scope is a section of the programme where variables can be declared, and there are three places where variables can be declared in general:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Inside a function or a block which is called local variables,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the definition of function parameters which is called formal parameters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outside of all functions which is called global variables.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without such a concept, a program could perform some tasks, but they would be extremely limited and not terribly interesting.&lt;br&gt;
We'll approach learning about scope by thinking of it as a dialogue.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Engine: responsible for start-to-finish compilation and execution of our JavaScript program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compiler: one of Engine's friends; handles all the dirty work of parsing and code-generation (see previous section).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scope: another friend of Engine; collects and maintains a look-up list of all the declared identifiers (variables), and enforces a strict set of rules as to how these are accessible to currently executing code. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Compiler:&lt;/strong&gt;&lt;br&gt;
         A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses.&lt;br&gt;
In a traditional compiled-language process, a chunk of source code, your program, will undergo typically three steps before it is executed, roughly called "compilation":&lt;br&gt;
&lt;strong&gt;Tokenizing/Lexing:&lt;/strong&gt;&lt;br&gt;
     Breaking up a string of characters into meaningful (to the language) chunks, called tokens.For instance, consider the program:&lt;code&gt;var a = 2;&lt;/code&gt;This program would likely be broken up into the following tokens:&lt;code&gt;var, a, =, 2,&lt;/code&gt; and &lt;code&gt;;&lt;/code&gt;. Whitespace may or may not be persisted as a token, depending on whether it's meaningful or not.&lt;br&gt;
The difference between tokenizing and lexing is  complex and technical distinction.&lt;br&gt;
&lt;strong&gt;Parsing:&lt;/strong&gt;&lt;br&gt;
      Converting a stream (array) of tokens into a tree of nested elements that collectively indicate the program's grammatical structure This type of tree is known as a "AST" (Abstract Syntax Tree).&lt;br&gt;
The tree for &lt;code&gt;var a = 2;&lt;/code&gt; might start with a top-level node called &lt;code&gt;VariableDeclaration&lt;/code&gt;, with a child node called Identifier (whose value is a), and another child called &lt;code&gt;AssignmentExpression&lt;/code&gt; which itself has a child called &lt;code&gt;NumericLiteral&lt;/code&gt; (whose value is &lt;code&gt;2&lt;/code&gt;).&lt;br&gt;
&lt;strong&gt;Code-Generation:&lt;/strong&gt;&lt;br&gt;
    The procedure for converting an AST into executable code. This component varies a lot based on the language, the platform it's aimed towards, and other factors.&lt;/p&gt;

&lt;p&gt;We need a little bit more compiler terminology to proceed further with understanding.&lt;/p&gt;

&lt;p&gt;When Engine executes the code that Compiler produced for step (2), it has to look-up the variable a to see if it has been declared, and this look-up is consulting Scope. But the type of look-up Engine performs affects the outcome of the look-up.&lt;/p&gt;

&lt;p&gt;In our case, it is said that Engine would be performing an "LHS" look-up for the variable a. The other type of look-up is called "RHS".&lt;/p&gt;

&lt;p&gt;I bet you can guess what the "L" and "R" mean. These terms stand for "Left-hand Side" and "Right-hand Side".&lt;br&gt;
let give a example:&lt;br&gt;
 &lt;code&gt;console.log( a );&lt;/code&gt;&lt;br&gt;
The reference to a is an RHS reference, because nothing is being assigned to a here. Instead, we're looking-up to retrieve the value of a, so that the value can be passed to console.log(..).&lt;br&gt;
By contrast:&lt;br&gt;
&lt;code&gt;a = 2;&lt;/code&gt;&lt;br&gt;
The reference to a here is an LHS reference, because we don't actually care what the current value is, we simply want to find the variable as a target for the = 2 assignment operation.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data type in javascript:</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Fri, 04 Mar 2022 10:42:34 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/data-type-in-javascript-2o9k</link>
      <guid>https://dev.to/bilalniaz15/data-type-in-javascript-2o9k</guid>
      <description>&lt;p&gt;There are eight basic data types in JavaScript. We can put any type in a variable. For example, a variable can at one moment be a string and then store a number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// no error
let message = "hello";
message = 123456
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1) Number&lt;/strong&gt;&lt;br&gt;
      The number type represents both integer and floating point numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let n = 123;
n = 12.345;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aside from conventional numbers, this data type also includes "special numeric values" such as Infinity, -Infinity, and NaN.&lt;br&gt;
Infinity represents the mathematical Infinity ∞. It is a special value that’s greater than any number.&lt;/p&gt;

&lt;p&gt;We can get it as a result of division by zero:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert( 1 / 0 ); // Infinity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NaN represents a computational error. It is a result of an incorrect or an undefined mathematical operation, for instance&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert( "not a number" / 2 ); // NaN, such division is erroneous
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Special numeric values formally belong to the “number” type. Of course they are not numbers in the common sense of this word.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) BigInt&lt;/strong&gt;&lt;br&gt;
    The "number" type in JavaScript cannot express integer values greater than &lt;code&gt;(2^53-1)&lt;/code&gt; (that is, 9007199254740991), or negative values less than -(2^53-1). It's a technological stumbling block resulting from their internal representation.&lt;br&gt;
BigInt type was recently added to the language to represent integers of arbitrary length.&lt;br&gt;
A BigInt value is created by appending n to the end of an integer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// the "n" at the end means it's a BigInt
const bigInt = 1234567890123456789012345678901234567890n;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3) String&lt;/strong&gt;&lt;br&gt;
     JavaScript's String type is used to represent textual data. It is a set of "elements" of 16-bit unsigned integer values. Each element in the String occupies a position in the String. The first element is at index 0, the next at index 1, and so on. The length of a String is the number of elements in it. In JavaScript, there are 3 types of quotes.&lt;br&gt;
Double quotes.&lt;br&gt;
Single quotes.&lt;br&gt;
Backticks. &lt;br&gt;
Double and single quotes are “simple” quotes. There’s practically no difference between them in JavaScript.&lt;/p&gt;

&lt;p&gt;Backticks are “extended functionality” quotes. They allow us to embed variables and expressions into a string by wrapping them in ${…}, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;et str = "Hello";//double quotes
let str2 = 'Single quotes are ok too';//single quotes
let phrase = `can embed another ${str}`;//Backticks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4) Boolean (logical type)&lt;/strong&gt;&lt;br&gt;
      Boolean represents a logical entity and can have two values: true and false .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let nameFieldChecked = true; // yes, name field is checked
let ageFieldChecked = false; // no, age field is not checked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boolean values also come as a result of comparisons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isGreater = 4 &amp;gt; 1;
console.log( isGreater ); // true (the comparison result is yes)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5) null&lt;/strong&gt;&lt;br&gt;
       The Null type has exactly one value: null.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;n JavaScript, null is not a “reference to a non-existing object” or a “null pointer” like in some other languages.&lt;/p&gt;

&lt;p&gt;It’s just a special value which represents “nothing”, “empty” or “value unknown”.&lt;br&gt;
&lt;strong&gt;6) undefined&lt;/strong&gt;&lt;br&gt;
      A variable that has not been assigned a value has the value undefined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age;
console.log(age); // shows "undefined"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technically, it is possible to explicitly assign undefined to a 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 age = 100;
// change the value to undefined
age = undefined;
console.log(age); // "undefined"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7) Object&lt;/strong&gt;&lt;br&gt;
   In JavaScript, objects can be seen as a collection of properties. With the object literal syntax, a limited set of properties are initialized; then properties can be added and removed.An object can be created with figure brackets {…} with an optional list of properties. A property is a “key: value” pair, where key is a string (also called a “property name”), and value can be anything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = new Object(); // "object constructor" syntax
let user = {};  // "object literal" syntax
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can immediately put some properties into {...} as “key: value” pairs. The last property in the list may end with a comma:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = {     // an object
  name: "John",  // by key "name" store value "John"
  age: 30        // by key "age" store value 30
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Property values are accessible using the dot notation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// get property values of the object:
console.log( user.name ); // John
console.log( user.age ); // 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a new value to an object is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.city = "Lahore"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove a property, we can use delete operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete user.age;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8) Symbol&lt;/strong&gt;&lt;br&gt;
    A Symbol is a unique and immutable primitive value and may be used as the key of an Object property (see below). In some programming languages, Symbols are called "atoms".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Here are two symbols with the same description:
let Sym1 = Symbol("Sym")
let Sym2 = Symbol("Sym")

console.log(Sym1 === Sym2) // returns "false"
// Symbols are guaranteed to be unique.
// Even if we create many symbols with the same description,
// they are different values.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Symbol type is a new feature in ECMAScript 2015. There is no ECMAScript 5 equivalent for Symbol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
      &lt;code&gt;number&lt;/code&gt; for numbers of any kind: integer or floating-point, integers are limited by ±(253-1).&lt;br&gt;
&lt;code&gt;bigint&lt;/code&gt; is for integer numbers of arbitrary length.&lt;br&gt;
&lt;code&gt;string&lt;/code&gt; for strings. A string may have zero or more characters, there’s no separate single-character type.&lt;br&gt;
&lt;code&gt;boolean&lt;/code&gt; for true/false.&lt;br&gt;
&lt;code&gt;null&lt;/code&gt; for unknown values &lt;br&gt;
&lt;code&gt;undefined&lt;/code&gt; for unassigned values &lt;br&gt;
&lt;code&gt;object&lt;/code&gt;for more complex data structures.&lt;br&gt;
&lt;code&gt;symbol&lt;/code&gt; for unique identifiers.&lt;br&gt;
I hope you enjoy it.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Differences Between Arrow and Regular Functions</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Sat, 26 Feb 2022 12:37:46 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/differences-between-arrow-and-regular-functions-4k68</link>
      <guid>https://dev.to/bilalniaz15/differences-between-arrow-and-regular-functions-4k68</guid>
      <description>&lt;p&gt;The fat arrow function is another name for an arrow function. It's a new feature in ES6 that allows you to write function expressions in a more compact manner. Regular JavaScript functions and arrow functions are similar in operation, although there are several distinctions. Let's have a look at the differences: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Syntax&lt;/li&gt;
&lt;li&gt;Arguments binding&lt;/li&gt;
&lt;li&gt;Use of this keyword&lt;/li&gt;
&lt;li&gt;Using a new keyword&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Syntax&lt;/strong&gt;
    By writing a few lines of code using arrow functions, a programmer can get the same result as ordinary functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8_k3pm3a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njbvlctq1s4mbqhrm82e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8_k3pm3a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njbvlctq1s4mbqhrm82e.png" alt="Image description" width="714" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Arguments binding&lt;/strong&gt;
 arguments object inside the regular functions contains the list of arguments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SIvayaUq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8k0c1llsnf3yussvrxj2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SIvayaUq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8k0c1llsnf3yussvrxj2.png" alt="Image description" width="679" height="235"&gt;&lt;/a&gt;&lt;br&gt;
The arrow function, on the opposite, doesn’t define arguments i.e. they do not have arguments binding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Swsyc-qO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1r3cjfqo1dsfngyy9e5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Swsyc-qO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1r3cjfqo1dsfngyy9e5.png" alt="Image description" width="685" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use of this keyword&lt;/strong&gt;
  This value is dynamic inside a standard JavaScript function. Because of the dynamic context, the value of this variable changes depending on how the function is called.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WpoIQEDV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4kmeaauc9ichydyr8h4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WpoIQEDV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4kmeaauc9ichydyr8h4.png" alt="Image description" width="680" height="240"&gt;&lt;/a&gt;&lt;br&gt;
Because an arrow function lacks its own "this" keyword, the behaviour of this inside an arrow function differs significantly from that of an ordinary function.&lt;br&gt;
This inside an arrow function has the same value throughout its lifetime and is always linked to the value of this in the nearest non-arrow parent function, which means This value inside an arrow function always equals this value from the outer function, regardless of how or where it is executed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GfcUXrk9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw6olrqwzm3a18s0lg46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GfcUXrk9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw6olrqwzm3a18s0lg46.png" alt="Image description" width="690" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using a new keyword&lt;/strong&gt;
    Regular functions can be built and called. The new keyword can be used to call them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YBeoOLJD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgp4q97ry44rkhyh3bs4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YBeoOLJD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgp4q97ry44rkhyh3bs4.png" alt="Image description" width="693" height="165"&gt;&lt;/a&gt;&lt;br&gt;
But, the arrow functions are only callable and not constructible, i.e., arrow functions can never be used as constructor functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LkPQMxDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iugg8ymew20ayasi22j5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LkPQMxDI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iugg8ymew20ayasi22j5.png" alt="Image description" width="697" height="136"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;summary&lt;/strong&gt;&lt;br&gt;
       Inside a normal function, this value is dynamic and changes depending on how the function is called. However, the inner arrow function is lexically bound and equals the outer function. This a value is always bound to the class instance using fat arrow methods.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>vue</category>
    </item>
    <item>
      <title>What is the difference between ES5 and ES6?</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Thu, 17 Feb 2022 14:07:38 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/what-is-the-difference-between-es5-and-es6-52p6</link>
      <guid>https://dev.to/bilalniaz15/what-is-the-difference-between-es5-and-es6-52p6</guid>
      <description>&lt;p&gt;*&lt;em&gt;1. ECMAScript 5 (ES5P) : *&lt;/em&gt;&lt;br&gt;
     The first major modification to JavaScript was ECMAScript 2009, sometimes known as ES5.Contractors who focus on how objects are instantiated are known as function contractors. In ES5, you must use the function keyword and return to define the function, just as you would in any other JavaScript language.&lt;br&gt;
*&lt;em&gt;2. ECMAScript 6 (ES6) : *&lt;/em&gt;&lt;br&gt;
The second major change to JavaScript was ECMAScript 2015.Its class allows developers to create an object with the new operator and an arrow function if they don't need to use the function keyword to specify the function, and they can also avoid using the return keyword to get the computer value.&lt;br&gt;
*&lt;em&gt;Difference between ES5 and ES6 : *&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;String, integer, boolean, null, and undefined are all primitive data types supported by ES5.&lt;br&gt;
But In ES6, there are some additions to JavaScript data types. It introduced a new primitive data type ‘symbol’ for supporting unique values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Only the var keyword can be used to define variables in ES5. In ES5,let and const are two new ways to define variables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When compared to ES6, the performance of ES5 is lesser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In ES 6 Object manipulation is less time-consuming then ES5.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To define a function in ES5, both the function and return keywords are used. An arrow function is a new feature introduced in ES6 by which we don’t require the function keyword to define the function.&lt;br&gt;
Follow Me : &lt;a href="https://twitter.com/Bilalniaz15"&gt;Twitter&lt;/a&gt;  &lt;a href="https://www.linkedin.com/in/bilal-niaz-147792214/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>vue</category>
      <category>react</category>
    </item>
    <item>
      <title>Some Best Linux distributions .</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Sat, 12 Feb 2022 10:00:50 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/some-good-linux-distros-to-consider-53g5</link>
      <guid>https://dev.to/bilalniaz15/some-good-linux-distros-to-consider-53g5</guid>
      <description>&lt;p&gt;Linux is a Unix-based free and open-source operating system. Because of its security and versatility, Linux has gotten a lot of attention lately and is widely utilised. We'll go over some of the top Linux Distros, also known as Linux Distributions, in this blog. Linux distros are operating systems that use the Linux kernel as their foundation.&lt;br&gt;
&lt;strong&gt;Linux Mint:&lt;/strong&gt;&lt;br&gt;
    Linux Mint is a popular distribution of Linux based on Ubuntu and Debian. It is a community-driven free and open-source Linux distribution providing a huge number of packages. It is easy to use with an interactive User Interface. In October 2012, Linux Format titled Linux Mint as the best distribution of 2012. It was first released as a beta version 1.0 called 'Ada' in 2006.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rXBkxpFA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oybthzcr2f1hxr04umv8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rXBkxpFA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oybthzcr2f1hxr04umv8.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ubuntu:&lt;/strong&gt;&lt;br&gt;
    This is one of the most commonly used Linux distributions. It is frequently chosen among Linux newcomers because of its user-friendly interface and aesthetics. It is compatible with not only PCs, but also tablets and cellphones. Many other Linux distributions, such as Lubuntu 20.04 LTS, Kubuntu 20.04, and Linux Mint 20.04 LTS, use Ubuntu as a base (Ulyana). Every six months, it provides updated versions with security and bug patches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7Ygj8cQe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ot46zar5lqqtqtfytqp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Ygj8cQe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ot46zar5lqqtqtfytqp5.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pop_OS! from System76&lt;/strong&gt;&lt;br&gt;
    System 76's Pop OS! is a Linux distribution with a customised GNOME desktop. It was originally released in October 2017 after only a few months of development. Pop OS! also includes a number of pre-installed applications such as Geary, LibreOffice, and Firefox, with additional software available through APT, Pop OS's package manager.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nTnkmDxJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5rcavexjzhch63lvnml.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nTnkmDxJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5rcavexjzhch63lvnml.jpg" alt="Image description" width="500" height="281"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;MX Linux:&lt;/strong&gt;&lt;br&gt;
     MX Linux is a popular Linux distribution based on Debian. It was initially launched in March 2014 and is designed to be user-friendly for both beginning and advanced Linux users. Its development began with a discussion inside the MEPIS community, which was later joined by antiX. MX Linux comes with several basic utilities, such as a graphic installer, a GUI-based mechanism for changing the Linux kernel, MX-snapshot, and so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XL93aziG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r7n4bwdi54o0d72uuyx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XL93aziG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r7n4bwdi54o0d72uuyx.jpg" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Elementary OS:&lt;/strong&gt;&lt;br&gt;
    Elementary OS is a Linux distribution developed and maintained by Elementary, Inc. that is based on Ubuntu LTS. It includes Pantheon, a unique desktop environment, as well as numerous custom programmes such as Photos, Music, Videos, Calendar, Terminal, Files, and more. It also includes some well-known applications, such as the Epiphany web browser and a branch of Geary mail. According to Elementary OS, it is a quick, open, and privacy-conscious alternative to Windows and macOS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9k0VfoOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09jlbp4o2nhjfzz65tqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9k0VfoOX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/09jlbp4o2nhjfzz65tqh.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Fedora:&lt;/strong&gt;&lt;br&gt;
   Fedora is created by the Fedora Project, which is supported by Red Hat. It's one of the most user-friendly distributions out there. GNOME is Fedora's default desktop environment, and the GNOME Shell is the default user interface, but other desktop environments are also available and can be installed. Fedora comes with a variety of software pre-loaded, and additional software can be installed using the DNF package manager. When Red Hat Enterprise Linux was discontinued in 2003, Fedora Linux was released.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kChqIF3c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0n9d4j7blb9vblvtrl6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kChqIF3c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0n9d4j7blb9vblvtrl6.jpg" alt="Image description" width="880" height="550"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Zorin:&lt;/strong&gt;&lt;br&gt;
   Zorin is an Ubuntu-based Linux distribution. It includes a simple graphical user interface (GUI) and programmes that are comparable to those found in Windows, and it was created with beginners transitioning from Windows to Linux in mind. It allows customers to utilise Windows software that is compatible with it for a smooth transition. Zorin OS Company, based in Dublin, was founded in 2009 and is written in C, C++, Python, D, and Java.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ogm2mmIe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75lgur4sm0lb6la38drj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ogm2mmIe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75lgur4sm0lb6la38drj.jpg" alt="Image description" width="880" height="330"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Deepin&lt;/strong&gt;&lt;br&gt;
    Deepin Linux is also known as Linux. Deepin and Hiweed Linux is a Debian-based operating system. DDE, the Deepin Desktop Environment, is its own desktop environment. Wuhan Deepin Technology in Wuhan, China, created and maintains it. As a result, Chinese people are the ones who use it the most. It was first launched in February 2004, and Wuhan Deepin Technology later joined the Linux Foundation in 2015.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XyH0IAz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2jvqdlt7ibkj2v7onf4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XyH0IAz9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2jvqdlt7ibkj2v7onf4.jpg" alt="Image description" width="880" height="489"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Solus:&lt;/strong&gt;&lt;br&gt;
     Solus is a Linux kernel-based operating system. It was previously known as Evolve OS. It is designed for usage on personal computers and in private. It makes no particular claims about software support for corporate and server environments. Version 1.0 of Solus was released in December 2015. It's reliable, simple to use, and appears to contain a large variety of the most recent software in its own repositories. Budgie, GNOME, KDE Plasma, and MATE are among the desktop environments available. Solus is only compatible with 64-bit PCs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aGIob5Qd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuh0v7xqysunq42sdw8n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aGIob5Qd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kuh0v7xqysunq42sdw8n.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Manjaro:&lt;/strong&gt;&lt;br&gt;
    Manjaro Linux is based on the Arch Linux operating system. It uses the Pacman package manager to allow the installation of software and programmes. Manjaro uses the GNOME desktop environment, and while it can be installed on any computer, some manufacturers sell their products with Manjaro already installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8BVabcS8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0vyvb7ogohb07lmbs9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8BVabcS8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0vyvb7ogohb07lmbs9g.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>hacktoberfest</category>
      <category>viru</category>
    </item>
    <item>
      <title>What are NPM, NPX, NVM, YARN, PNPM?</title>
      <dc:creator>Bilal Niaz </dc:creator>
      <pubDate>Thu, 03 Feb 2022 13:24:44 +0000</pubDate>
      <link>https://dev.to/bilalniaz15/what-is-npm-npx-nvm-and-yarn-hpl</link>
      <guid>https://dev.to/bilalniaz15/what-is-npm-npx-nvm-and-yarn-hpl</guid>
      <description>&lt;p&gt;You've probably heard of NPM, NPX, NVM and Yarn if you deal with JavaScript. Almost certainly, you've used them to install something. In this piece, I'll explain what they are, as well as the differences between NPX, NPM, NVM, and Yarn as well as their benefits and drawbacks.&lt;br&gt;
&lt;strong&gt;NPM:&lt;/strong&gt;&lt;br&gt;
                          When you install Node on your PC, you also install npm (which is included by default).&lt;br&gt;
NPM(Node Package Manager) is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently.&lt;br&gt;
Packages are updated as well, and npm makes it easy for us to stay on top of things. It allows us to.&lt;br&gt;
If we want to, we can upgrade the package, or we can utilise a different version if that's what we need. &lt;br&gt;
&lt;strong&gt;NVM:&lt;/strong&gt;&lt;br&gt;
   NVM(Node Version Manager) which stands for Node Version Manager, is to allow you to check the version of Node JS.you have installed and even to install a fresh, most up to date version of Node. It also allows you to install numerous instances of Node, allowing you to test your app in different versions of the programme to see if it works.&lt;br&gt;
&lt;strong&gt;NPX:&lt;/strong&gt;&lt;br&gt;
      The npx stands for Node Package Execute and is included with npm. If you install npm above version 5.2.0, npx will be installed as well.&lt;br&gt;
It's a npm package runner that allows you to run any package from the npm registry without having to install it. During a one-time usage package, the npx is useful. Npx is not installed in your computers if you have installed npm prior to 5.2.0.&lt;br&gt;
&lt;strong&gt;YARN:&lt;/strong&gt;&lt;br&gt;
       YARN(Yet Another Resource Negotiator) is a package manager similar to npm, but One of the main difference between NPM and Yarn is how they handle the package installation process. Yarn installs packages in parallel. &lt;br&gt;
Yarn is optimized to fetch and install multiple packages simultaneously(yarn is faster than npm at installing packages).&lt;br&gt;
&lt;strong&gt;PNPM:&lt;/strong&gt;&lt;br&gt;
       PNPM is an alternative package manager for Node.js which stands for “Performant NPM”.&lt;br&gt;
The main purpose of PNPM is to hold all the packages at a global (centralized) store and use them if needed by other projects too by creating hard links to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
      The V8 Javascript runtime underpins Node.js. A Javascript engine is built into each browser, including Firefox, Safari, and Chrome, to handle Javascript files on webpages. The V8 engine is used by Google Chrome and Node.js to interpret Javascript files.&lt;/p&gt;

&lt;p&gt;I hope this information will assist you in deciding whether to use Yarn, NPM, or NVM in your projects. This article will be updated on a regular basis, and I encourage suggestions and comments.&lt;br&gt;
Follow Me : &lt;a href="https://twitter.com/Bilalniaz15" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;  &lt;a href="https://www.linkedin.com/in/bilal-niaz-147792214/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

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