<?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>Forem: Jay Jethava</title>
    <description>The latest articles on Forem by Jay Jethava (@jay_jethava_3bc967a3da87d).</description>
    <link>https://forem.com/jay_jethava_3bc967a3da87d</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%2F2036054%2Ff43abd44-8402-4fdf-85d2-dc10b1c652e3.jpg</url>
      <title>Forem: Jay Jethava</title>
      <link>https://forem.com/jay_jethava_3bc967a3da87d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jay_jethava_3bc967a3da87d"/>
    <language>en</language>
    <item>
      <title>Avoid Bugs in Your Code: Mutating vs. Non-Mutating Methods in Moment.js</title>
      <dc:creator>Jay Jethava</dc:creator>
      <pubDate>Fri, 13 Sep 2024 11:52:04 +0000</pubDate>
      <link>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-19oi</link>
      <guid>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-19oi</guid>
      <description>&lt;p&gt;When working with Moment.js, it’s essential to know which methods change the original date object and which return new values. This can help you avoid unintended side effects in your code. Here’s a quick guide:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔄Methods that Mutate the Original Date Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;startOf(unit)&lt;/strong&gt; — Sets the date to the start of the specified unit (e.g., ‘year’, ‘month’, ‘day’).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;endOf(unit)&lt;/strong&gt; — Sets the date to the end of the specified unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;add(value, unit)&lt;/strong&gt; — Adds time to the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;subtract(value, unit)&lt;/strong&gt; — Subtracts time from the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;set(unit, value)&lt;/strong&gt; — Sets the specified unit of the original Moment object to the given value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🆕 &lt;strong&gt;Methods that Return a New Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;toISOString()&lt;/strong&gt; — Converts the Moment object to an ISO 8601 string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toDate()&lt;/strong&gt; — Converts the Moment object to a native JavaScript Date object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;format()&lt;/strong&gt; — Formats the Moment object as a string based on the provided • format string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;clone()&lt;/strong&gt; — Creates a copy of the Moment object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing the difference between mutating and non-mutating methods in Moment.js is crucial for writing clean and predictable code. Be mindful of these distinctions to avoid unexpected bugs and improve code maintainability.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>Avoid Bugs in Your Code: Mutating vs. Non-Mutating Methods in Moment.js</title>
      <dc:creator>Jay Jethava</dc:creator>
      <pubDate>Fri, 13 Sep 2024 11:52:04 +0000</pubDate>
      <link>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-25j6</link>
      <guid>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-25j6</guid>
      <description>&lt;p&gt;When working with Moment.js, it’s essential to know which methods change the original date object and which return new values. This can help you avoid unintended side effects in your code. Here’s a quick guide:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔄Methods that Mutate the Original Date Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;startOf(unit)&lt;/strong&gt; — Sets the date to the start of the specified unit (e.g., ‘year’, ‘month’, ‘day’).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;endOf(unit)&lt;/strong&gt; — Sets the date to the end of the specified unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;add(value, unit)&lt;/strong&gt; — Adds time to the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;subtract(value, unit)&lt;/strong&gt; — Subtracts time from the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;set(unit, value)&lt;/strong&gt; — Sets the specified unit of the original Moment object to the given value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🆕 &lt;strong&gt;Methods that Return a New Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;toISOString()&lt;/strong&gt; — Converts the Moment object to an ISO 8601 string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toDate()&lt;/strong&gt; — Converts the Moment object to a native JavaScript Date object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;format()&lt;/strong&gt; — Formats the Moment object as a string based on the provided • format string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;clone()&lt;/strong&gt; — Creates a copy of the Moment object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing the difference between mutating and non-mutating methods in Moment.js is crucial for writing clean and predictable code. Be mindful of these distinctions to avoid unexpected bugs and improve code maintainability.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>Avoid Bugs in Your Code: Mutating vs. Non-Mutating Methods in Moment.js</title>
      <dc:creator>Jay Jethava</dc:creator>
      <pubDate>Fri, 13 Sep 2024 11:52:04 +0000</pubDate>
      <link>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-4f7m</link>
      <guid>https://forem.com/jay_jethava_3bc967a3da87d/avoid-bugs-in-your-code-mutating-vs-non-mutating-methods-in-momentjs-4f7m</guid>
      <description>&lt;p&gt;When working with Moment.js, it’s essential to know which methods change the original date object and which return new values. This can help you avoid unintended side effects in your code. Here’s a quick guide:&lt;/p&gt;

&lt;p&gt;🔄 &lt;strong&gt;Methods that Mutate the Original Date Object&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;startOf(unit)&lt;/strong&gt; — Sets the date to the start of the specified unit (e.g., ‘year’, ‘month’, ‘day’).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;endOf(unit)&lt;/strong&gt; — Sets the date to the end of the specified unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;add(value, unit)&lt;/strong&gt; — Adds time to the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;subtract(value, unit)&lt;/strong&gt; — Subtracts time from the original Moment object based on the specified value and unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;set(unit, value)&lt;/strong&gt; — Sets the specified unit of the original Moment object to the given value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🆕 &lt;strong&gt;Methods that Return a New Object:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;toISOString()&lt;/strong&gt; — Converts the Moment object to an ISO 8601 string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;toDate()&lt;/strong&gt; — Converts the Moment object to a native JavaScript Date object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;format()&lt;/strong&gt; — Formats the Moment object as a string based on the provided • format string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;clone()&lt;/strong&gt; — Creates a copy of the Moment object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing the difference between mutating and non-mutating methods in Moment.js is crucial for writing clean and predictable code. Be mindful of these distinctions to avoid unexpected bugs and improve code maintainability.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>𝗘𝗻𝗵𝗮𝗻𝗰𝗶𝗻𝗴 𝗔𝗣𝗜 𝗖𝗹𝗮𝗿𝗶𝘁𝘆: 𝗣𝗼𝘀𝘁𝗺𝗮𝗻 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻 𝗕𝗲𝘀𝘁 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝘀</title>
      <dc:creator>Jay Jethava</dc:creator>
      <pubDate>Fri, 06 Sep 2024 12:24:47 +0000</pubDate>
      <link>https://forem.com/jay_jethava_3bc967a3da87d/-5gfb</link>
      <guid>https://forem.com/jay_jethava_3bc967a3da87d/-5gfb</guid>
      <description>&lt;p&gt;Today, I’m excited to share some of the steps I’ve taken to simplify the API workflows using Postman, bridging the gap between front-end and back-end teams for smoother collaboration.&lt;/p&gt;

&lt;p&gt;𝗞𝗲𝘆 𝗗𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻 𝗖𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁𝘀:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95g7pb4gofbds0jwtc70.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95g7pb4gofbds0jwtc70.png" alt="API Documentation In Postman" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;𝗔𝗶𝗺&lt;br&gt;
• This outlines the primary purpose of the API endpoint.&lt;br&gt;
• This helps developers to understand the specific functionality that the endpoint provides, ensuring that they use it correctly in their applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;𝗔𝗰𝗰𝗲𝘀𝘀&lt;br&gt;
• This specifies “who is authorised to make requests to this endpoint?”.&lt;br&gt;
• This helps developers to avoid unnecessary errors or access issues during integration by clarifying the security requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;𝗜𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻&lt;br&gt;
• This explains how the API endpoint is integrated within the front end.&lt;br&gt;
• This details the specific front-end components or pages that rely on this endpoint.&lt;br&gt;
• This helps developers to easily debug issues and make changes without disrupting other parts of the application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;𝗣𝗮𝘆𝗹𝗼𝗮𝗱&lt;br&gt;
• If the API is accepting some data in the body/payload then save an example of the payload.&lt;br&gt;
• This helps developers see exactly what data format and structure they need to provide, ensuring proper API calls.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By focusing on these essential elements, I ensure the API documentation is not just informative but also practical, enhancing productivity and reducing integration and debugging time.&lt;/p&gt;

</description>
      <category>api</category>
      <category>softwaredevelopment</category>
      <category>backend</category>
      <category>postman</category>
    </item>
  </channel>
</rss>
