<?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: Feroj Alam</title>
    <description>The latest articles on DEV Community by Feroj Alam (@feroj7).</description>
    <link>https://dev.to/feroj7</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%2F781990%2Fb80f3b8b-45a0-486a-9c43-313c29155962.jpeg</url>
      <title>DEV Community: Feroj Alam</title>
      <link>https://dev.to/feroj7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/feroj7"/>
    <language>en</language>
    <item>
      <title>Explanation on mongodb CRUD operations</title>
      <dc:creator>Feroj Alam</dc:creator>
      <pubDate>Thu, 30 Dec 2021 12:24:17 +0000</pubDate>
      <link>https://dev.to/feroj7/explanation-on-mongodb-crud-operations-480n</link>
      <guid>https://dev.to/feroj7/explanation-on-mongodb-crud-operations-480n</guid>
      <description>&lt;p&gt;Mongodb is used to store data that is a NoSQL database. Mongodb is a document-oriented database. In database we make CRUD operations to store and use data. C means Create, R means Read, U means update, and D means delete data. Now we know about these in detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create:&lt;/strong&gt; Create operations are used to insert documents into a collection.We can use it two ways. They are-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.insertOne()
db.collection.insertMany()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using insertOne() we can create single document in a collection and using insertMany() we can create more than one document in a collection.&lt;br&gt;
Example: Use of insertOne()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.cars.insertOne(
//inserting Bugatti Veyron Mansory Vivere-2005 into cars collection
    {
       name: "Bugatti Veyron Mansory Vivere"
       model: "2005"
    }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here one car data is inserted into car collection using insertOne() method.&lt;br&gt;
Use of insertMany()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.cars.insertMany([{
//inserting three cars along with their models into cars collection
       name: "Bugatti Veyron Mansory Vivere"
       model: "2005"
},{
      name: "Aston Martin AM-RB 001"
       model: "2018"
},{
       name: "Ferrari Pininfarina Sergio"
       model: "2013"
}])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here three car data is inserted into car collection using insertMany() method.&lt;br&gt;
&lt;strong&gt;Read:&lt;/strong&gt; Read operation is used to get data from a collection. We can use two method to get data. They are-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.find()
db.collection.find(query)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using find() method we can get all document from a collection because this method returns all document if we do not give any parameter. If we give any parameter to filter or specify document then it returns the filtered documents.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; db.cars.find() // no parameters
Output:
{ "_id" : ObjectId("1"), "name" : "Bugatti Veyron Mansory Vivere", "model" : "2005" }
{ "_id" : ObjectId("2"), "name" : "Aston Martin AM-RB 001", "model" : "2018" }
{ "_id" : ObjectId("3"), "name" : "Ferrari Pininfarina Sergio", "2013" : "2005" }
&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;db.cars.find({"model": "2005"}) // with one paramter
output:
{ "_id" : ObjectId("1"), "name" : "Bugatti Veyron Mansory Vivere", "model" : "2005" }
Update: Update operation is used to modify document into a collection. We can use three methods to modify the existing document. They are- 
db.collection.updateOne()
db.collection.updateMany()
db.collection.replaceOne()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we use updateOne() method it modify the given filtered document. It does not remove the field rather than it will add a new field to the document.&lt;br&gt;
When we use updateMany() method it will modify all the documents which are given for filter.&lt;br&gt;
When we use replaceOne() method it replace the entire document. It will replace the old fields and values with new data.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   "_id" : ObjectId("1"),
   "model" : 2005
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We make update operations in these document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;updateOne({"_id" : ObjectId("1")}, {$set: { "new_model" : 2020}})
Output:
{
   "_id" : ObjectId("1"),
   "model" : 2005,
   "new_model" : 2020
}
&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;updateMany({"_id" : ObjectId("1")}, {$set: { "name" : "NewName"}, $set: { "new_model" : 2020}})
Output:
{
   "_id" : ObjectId("1"),
   "model" : 2005,
   "new_model" : 2020
   "name" : "newName"
}
&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;replaceOne({"_id" : ObjectId("1")}, { "new_model" : 2020})
Output:
{
   "_id" : ObjectId("1"),
   "new_model" : 2020
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**Delete: **Delete operation is used to remove documents from a collection. We can use two methods to delete documents. They are-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.deleteOne()
db.collection.deleteMany()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we use deleteOne() method it removes only the first document which is matched by query filter.&lt;br&gt;
When we use deleteMany() method it will remove multiple documents at a time.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; db.cars.deleteOne(
//deletes one car having model "2013"
    { "model": "2013" }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will delete only one car object of 2013 model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.cars.deleteMany(
//delete all cars having model "2013"
    { "model": "2013" }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will delete all car objects of the 2013 model.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Explanation about react hooks</title>
      <dc:creator>Feroj Alam</dc:creator>
      <pubDate>Thu, 30 Dec 2021 10:46:07 +0000</pubDate>
      <link>https://dev.to/feroj7/explanation-about-react-hooks-m45</link>
      <guid>https://dev.to/feroj7/explanation-about-react-hooks-m45</guid>
      <description>&lt;p&gt;Hooks are an important thing in react functional component. For accessing state and other react features hooks are used. Today I am discussing react common hooks.&lt;/p&gt;

&lt;p&gt;In react, 16.8 version hooks are introduced. Hooks are functions that “hook into” react state and lifecycle features from react functional components. If you need to add a state in your react application previously you have to add this by converting it into class. But after the introduction of react hooks, you can add state by using hooks into functional components. So class components are no longer needed.&lt;/p&gt;

&lt;p&gt;Hooks are similar to javascript functions. You have to maintain 3 rules to use react hooks. These are-&lt;br&gt;
hooks call only at the top level of a component.&lt;br&gt;
hook call only inside the react functional components&lt;br&gt;
hooks can not be conditional&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useState hook:&lt;/strong&gt; react useState hook used to track the application state. State means any data or property that can be changed.&lt;br&gt;
If we want to use useState hook.First we have to import it from react.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import {useState} from ‘react’;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that we have to initialize it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const FavoriteColor = () =&amp;gt; {
    const [color, setColor] = useState(“”);
}
export default FavoriteColor;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;useState takes the initial state and returns two values. One is the current state that is here color and another is a function to make changes in the state that is setColor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useEffect hook:&lt;/strong&gt; react useEffect hook is used to handle side effects such as data fetching from API, updating DOM etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import {useEffect} from ‘react’;
const FavoriteColor = () =&amp;gt; {
    useEffect( ()=&amp;gt; {
    //fetch API
}, [ ])
}
export default FavoriteColor;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;useEffect takes two arguments one is a function we fetch data into this function another is a dependency which is optional. It is used for re-rendering. If there is an update that depends on something then we have to give it to the dependency.Then if there is any change in dependency the page will re-render.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useContext hook:&lt;/strong&gt; useContext hook give us the power to manage application state globally. If there are so many nested components in our application.If we need to pass data to the last components in the application, because of uni-directional data flow we have to pass the data through every component before it goes to the required component that called props drilling. UseContext hook brought the solution to this. We can store the data in context and wrap all components by this context. After that, any component that needs to access or update this data can easily be done it by useContext hook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState, createContext } from "react";
const UserContext = createContext()
function App() {

  return (
    &amp;lt;UserContext.Provider value={user}&amp;gt;
      &amp;lt;Component5 /&amp;gt;    
    &amp;lt;/UserContext.Provider&amp;gt;
  );
}
function Component5() {
  const user = useContext(UserContext);
  return (
    &amp;lt;&amp;gt;
      &amp;lt;h1&amp;gt;Component 5&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;{`Hello ${user} again!`}&amp;lt;/h2&amp;gt;
    &amp;lt;/&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Explanation of JavaScript "this" keyword
</title>
      <dc:creator>Feroj Alam</dc:creator>
      <pubDate>Tue, 28 Dec 2021 20:26:44 +0000</pubDate>
      <link>https://dev.to/feroj7/explanation-of-javascript-this-keyword-578j</link>
      <guid>https://dev.to/feroj7/explanation-of-javascript-this-keyword-578j</guid>
      <description>&lt;p&gt;this keyword is mostly used in object-oriented programming. Most of the beginners are confused with this keyword. Today I am trying to tell about this keyword easily so that everyone can understand.&lt;/p&gt;

&lt;p&gt;Generally, this keyword refers to the object by which it is bounded.&lt;br&gt;
this keyword has different values depending on the place of use.&lt;/p&gt;

&lt;p&gt;In a method, this refers to the owner object.&lt;br&gt;
Alone, this refers to the global object.&lt;br&gt;
In a function, this refers to the global object.&lt;br&gt;
In a function, in strict mode, this is undefined.&lt;br&gt;
In an event, this refers to the element that received the event.&lt;br&gt;
In the call() and apply() method this can refer to any object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a method:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const 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;In this object fullName is a method. Here this in fullName method refers to owner object that means person object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;this Alone:&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;console.log(this); //output window
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we use this alone the owner is the global object so this refers to the window 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”
console.log(this); //output window
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we use this alone in strict mode, it also refers to the global window object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  return this;
}
console.log(myFunction()); //output window
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we use this in a function this refers to the global window object.&lt;/p&gt;

&lt;p&gt;If we use this in a function in strict mode then 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;
}
console.log(myFunction()); //output undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;In an event:&lt;/strong&gt;&lt;br&gt;
If we use this in an event or javascript event handlers this refers to the element which is used to trigger the event. 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;&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;



&lt;p&gt;Here this refers to the button element because here button is the event trigger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In call() and apply() method:&lt;/strong&gt;&lt;br&gt;
call() and apply() methods both are javascript built-in methods.Both of them are used to call an object method with another object as the argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person1 = {
  fullName: function() {
    return this.firstName + " " + this.lastName;
  }
}
const person2 = {
  firstName:"John",
  lastName: "Doe",
}
const person3 = {
  firstName:"Feroj",
  lastName: "Alam",
}
console.log(person1.fullName.call(person2)); //output John Doe
console.log(person1.fullName.apply(person3)); //output Feroj Alam
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here person1 object has no first name and last name. We use the call() method to use first name and last name from another object which is person2. We can also use apply() method to use the first and last name from another object that is person3. So that this refers to the person2 object and person3 object.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>JavaScript string methods</title>
      <dc:creator>Feroj Alam</dc:creator>
      <pubDate>Tue, 28 Dec 2021 13:27:34 +0000</pubDate>
      <link>https://dev.to/feroj7/javascript-string-methods-54b5</link>
      <guid>https://dev.to/feroj7/javascript-string-methods-54b5</guid>
      <description>&lt;p&gt;Today I am telling you about the most important JavaScript string methods with explanations and examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;charAt():&lt;/strong&gt; This method is used for extracting string characters. This method returns the character at a  specific index in a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "FEROJ ALAM";
let char = text.charAt(0); //output F
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;concat():&lt;/strong&gt; This method is used to join two or more strings together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text1 = "Feroj";
let text2 = "Alam";
let text3 = text1.concat(" ", text2); //output Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;concat() can be used instead of plus operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = "Feroj" + " " + "Alam";  //output Feroj Alam
text = "Hello".concat(" ", "World!");  //output Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These two line are same&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;includes():&lt;/strong&gt; This method is used to check that string we are searching for exists in that string. If string exists then it will return true, if not exist return 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 text = "Feroj Alam, web developer.";
let result = text.includes("web"); // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;includes() method is case sensitive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;endsWith():&lt;/strong&gt; This method is used to check that string ends with the string that we are searching for. If exists it will return true otherwise return false. This method is case-sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Programming Hero";
let result = text.endsWith("Hero");//output true
let text = "Programming Hero";
let result = text.endsWith("hero");//output false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;indexOf():&lt;/strong&gt; This method is used to find the position of a string. This method returns the first found string that we are looking for. If not found it returns -1. This method is also case-sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello world, welcome to the universe.";
let result = text.indexOf("welcome"); // output 13
let text = "Hello world, welcome to the universe.";
let result = text.indexOf("Welcome"); // output -1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;lastIndexOf():&lt;/strong&gt; This method is used to find the last positioned string position. It starts to find the string from the last. It gives the index from starting 0. It returns -1 if the value is not found. This method is case-sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello planet earth, you are a great planet.";
let result = text.lastIndexOf("planet"); //output 36
let text = "Hello planet earth, you are a great planet.";
let result = text.lastIndexOf("Planet"); //output -1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;replace():&lt;/strong&gt; This method is used to replace string for a given value or a regular expression. It returns a new string with replaced value. It does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Visit Microsoft!";
let result = text.replace("Microsoft", "Google"); //output Visit Google
let text = "Mr Blue has a blue house and a blue car";
let result = text.replace(/blue/g, "red"); //output Mr Blue has a red house and a red car
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;slice():&lt;/strong&gt; This method is used to extract specific strings. It returns the extracted string in a new string but does not change the original string. We have to give start and end index to slice or cut like (0, 5) and if we give a negative value it will extract from the last of string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello world!";
let result = text.slice(0, 5);//output Hello
let result = text.slice(3);//output lo world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;split():&lt;/strong&gt; This method is used to split or separate words to make an array. It will return a new array. It does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "How are you doing today?";
const myArray = text.split(" "); //output How,are,you,doing,today?
const myArray = text.split(""); //output H,o,w, ,a,r,e, ,y,o,u, ,d,o,i,n,g, ,t,o,d,a,y,?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we use (“ “) this as separator, string will split into words&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;startsWith():&lt;/strong&gt; This method is used to check that the string starts with the string that we are searching for. If found it returns true otherwise returns false. This method is case-sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello world, welcome to the universe.";
text.startsWith("Hello"); //output true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;substr():&lt;/strong&gt; It is used to extract or cut a part of a string.it receives the start and end position of extraction.it does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello world!";
let result = text.substr(1, 4); //output ello
let result = text.substr(2); //output llo world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;toLowerCase():&lt;/strong&gt; This method is used convert lowercase the characters of a string. It does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello World!";
let result = text.toLowerCase(); //output hello world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;toUpperCase():&lt;/strong&gt; It is used to convert the characters of a string to upper case. It also does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello World!";
let result = text.toUpperCase(); //HELLO WORLD!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;trim():&lt;/strong&gt; This method is used to remove extra spaces from both sides of a string. It does not change the original string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "    Hello World!        ";
let result = text.trim();//output Hello World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;trimStart():&lt;/strong&gt; This method is used to remove white space from the beginning of a string. If there is no white space it will return a new string without throwing an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "        Hello World!";
let result = text.trimStart();//output Hello World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;trimEnd():&lt;/strong&gt; It is used to remove white space from the ending of a string.If there is no white space it will return a new string without throwing an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello World!          ";
let result = text.trimEnd();//output Hello World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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