<?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: Vivek Mittal</title>
    <description>The latest articles on DEV Community by Vivek Mittal (@vivek96_).</description>
    <link>https://dev.to/vivek96_</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%2F224798%2F82bd991a-c15e-4ebe-bb87-5c5d8cb1c069.jpeg</url>
      <title>DEV Community: Vivek Mittal</title>
      <link>https://dev.to/vivek96_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivek96_"/>
    <language>en</language>
    <item>
      <title>Generative Engine Optimization (GEO): The New Frontier Beyond SEO</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Mon, 02 Jun 2025 15:17:24 +0000</pubDate>
      <link>https://dev.to/vivek96_/generative-engine-optimization-geo-the-new-frontier-beyond-seo-153e</link>
      <guid>https://dev.to/vivek96_/generative-engine-optimization-geo-the-new-frontier-beyond-seo-153e</guid>
      <description>&lt;p&gt;As generative AI platforms like ChatGPT, Claude, Gemini, and Perplexity become primary gateways to information, a new paradigm is emerging: &lt;strong&gt;Generative Engine Optimization (GEO)&lt;/strong&gt;. Much like SEO revolutionized the way we approached web visibility in search engines, GEO is poised to do the same for generative platforms.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What Is Generative Engine Optimization (GEO)?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Generative Engine Optimization (GEO)&lt;/strong&gt; refers to the strategic creation and structuring of content so that it is effectively surfaced, cited, or embedded by &lt;strong&gt;Generative AI (GAI)&lt;/strong&gt; systems when users ask questions.&lt;/p&gt;

&lt;p&gt;Unlike SEO, where the goal is to rank higher in a list of web links, GEO aims to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be &lt;strong&gt;referenced or quoted&lt;/strong&gt; in LLM-generated responses&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Influence&lt;/strong&gt; what LLMs present as answers&lt;/li&gt;
&lt;li&gt;Gain visibility &lt;strong&gt;inside&lt;/strong&gt; the generated content — not just as a clickable link&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔍 How GEO Differs from Traditional SEO
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;GEO&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;SEO&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Target System&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Generative AI tools like ChatGPT, Gemini, Perplexity&lt;/td&gt;
&lt;td&gt;Search engines like Google, Bing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Goal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Be referenced or quoted in AI-generated responses&lt;/td&gt;
&lt;td&gt;Appear in top results for keyword queries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ranking Signals&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data quality, authority, clarity, embedding proximity, model training&lt;/td&gt;
&lt;td&gt;Backlinks, metadata, keyword density, page speed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Content Format&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plain-language clarity, Q&amp;amp;A style, unambiguous facts&lt;/td&gt;
&lt;td&gt;Keyword-optimized blogs, landing pages, structured schema&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Indexing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fine-tuned training data, retrieval-augmented generation (RAG)&lt;/td&gt;
&lt;td&gt;Crawlers and sitemaps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🛠️ How Generative Engines Retrieve Information
&lt;/h2&gt;

&lt;p&gt;Modern LLMs rely on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Training data&lt;/strong&gt;: Websites, forums, Wikipedia, docs, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieval-augmented generation (RAG)&lt;/strong&gt;: External databases for grounding&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust signals&lt;/strong&gt;: Citation density, clarity, formatting, consistency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, your content must be not only &lt;em&gt;discoverable&lt;/em&gt; — but &lt;em&gt;memorable, factual, and semantically clear&lt;/em&gt; to LLMs.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 7 Strategies to Optimize for Generative Engines
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Write Clear, Direct Answers&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use short, declarative sentences. Structure your content to directly answer questions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Q: What is carbon offsetting?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
“Carbon offsetting is a climate mitigation practice where an entity compensates for its emissions by funding equivalent carbon savings elsewhere.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Use Structured Data &amp;amp; Schema Markup&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Implement &lt;code&gt;FAQPage&lt;/code&gt;, &lt;code&gt;Organization&lt;/code&gt;, and &lt;code&gt;Article&lt;/code&gt; schemas. Structured content makes it easier for LLMs to extract and prioritize information.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;Earn Trust and Citations&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Publish on reputable domains&lt;/li&gt;
&lt;li&gt;Get backlinks from trusted websites&lt;/li&gt;
&lt;li&gt;Mention your brand clearly in quotes and statistics&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;Keep Content Fresh and Updated&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Generative platforms (especially real-time ones like Perplexity) favor recent content. Add timestamps and update indicators.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. &lt;strong&gt;Optimize for Brand Mentions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Phrase sentences in a way that can be directly quoted by AI:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“According to &lt;strong&gt;ClimateFund.org&lt;/strong&gt;, an NGO working in reforestation…”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  6. &lt;strong&gt;Publish Long-Form Authoritative Content&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In-depth explainer content, whitepapers, and knowledge bases often become source material for LLM fine-tuning or memory.&lt;/p&gt;




&lt;h3&gt;
  
  
  7. &lt;strong&gt;Use Embeddings and APIs to Feed Data&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Leverage vector databases and embedding APIs to serve your own chatbot or AI assistant with accurate, updated, and branded content.&lt;/p&gt;




&lt;h2&gt;
  
  
  📈 How to Measure GEO Effectiveness
&lt;/h2&gt;

&lt;p&gt;While GEO lacks official dashboards (like Google Search Console for SEO), you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask ChatGPT, Claude, or Gemini about topics in your niche — are you cited?&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Perplexity.ai&lt;/strong&gt; to test which sources are referenced&lt;/li&gt;
&lt;li&gt;Track referral traffic from AI-based platforms&lt;/li&gt;
&lt;li&gt;Set up &lt;strong&gt;Google Alerts&lt;/strong&gt; for your key content phrases&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📌 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Generative Engine Optimization is not just a buzzword — it's a strategic shift in how information is distributed and consumed. As AI tools become dominant interfaces for knowledge, &lt;strong&gt;GEO is the new SEO&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The best time to adapt to GEO was yesterday.&lt;br&gt;&lt;br&gt;
The second-best time? Today.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🖼️ Bonus: GEO vs SEO Infographic
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o0f8wcks9skyv5vw7o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o0f8wcks9skyv5vw7o2.png" alt="Generative Engine Optimization vs SEO Infographic" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>llm</category>
      <category>rag</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Understanding JavaScript's Object-String Comparison</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Mon, 04 Dec 2023 16:55:49 +0000</pubDate>
      <link>https://dev.to/vivek96_/understanding-javascripts-object-string-comparison-23gi</link>
      <guid>https://dev.to/vivek96_/understanding-javascripts-object-string-comparison-23gi</guid>
      <description>&lt;p&gt;JavaScript's loose equality operator (==) often leads to intriguing comparisons due to its type coercion. One such comparison involves an empty object and a string. Let's delve into this scenario to understand the underlying principles.&lt;/p&gt;

&lt;p&gt;Consider the code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x = {};
console.log(x == "1");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One might intuitively expect this to output true. However, in JavaScript, this results in false. Why does this happen?&lt;/p&gt;

&lt;h2&gt;
  
  
  Type Coercion in JavaScript
&lt;/h2&gt;

&lt;p&gt;JavaScript employs type coercion when using the loose equality operator (==). It attempts to convert operands to a common type for comparison.&lt;/p&gt;

&lt;p&gt;In this case, the empty object x and the string "1" are inherently of different types. JavaScript attempts to coerce these values to a common type for comparison but fails to equate them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Comparison
&lt;/h2&gt;

&lt;p&gt;An empty object, {}, doesn’t naturally convert into a string resembling "1". Therefore, the comparison using == returns false.&lt;/p&gt;

&lt;p&gt;However, we can explore other ways to achieve a true comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  String Conversion and Equality
&lt;/h2&gt;

&lt;p&gt;To explicitly convert an object to a string for comparison, you can use the toString method or the String() function:&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(String(x) === "1"); // Outputs: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return false because an empty object converted to a string results in "[object Object]", not "1".&lt;/p&gt;

&lt;h2&gt;
  
  
  Overriding toString Method
&lt;/h2&gt;

&lt;p&gt;To make the comparison x == "1" evaluate to true, we can override the toString method of 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 x = {
  toString: function() {
    return "1";
  }
};

console.log(x == "1"); // Outputs: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the toString method explicitly returns "1", causing the comparison to yield true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;JavaScript's loose equality operator can produce unexpected results, especially when comparing different data types. Understanding type coercion and the behavior of specific data types is crucial to anticipate and manage these scenarios effectively.&lt;/p&gt;

&lt;p&gt;While an empty object and the string "1" are inherently dissimilar, explicit type conversion or method overriding can alter how these values are compared.&lt;/p&gt;

&lt;p&gt;By grasping these intricacies, developers can write more predictable and robust JavaScript code.&lt;/p&gt;

&lt;p&gt;JavaScript's type coercion is a powerful feature but requires careful handling to ensure accurate comparisons and operations.&lt;/p&gt;

&lt;p&gt;Understanding these nuances enables developers to navigate JavaScript's quirks and write more reliable and maintainable code.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Efficient DOM Manipulation with document.createDocumentFragment()</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Sat, 04 Nov 2023 10:04:48 +0000</pubDate>
      <link>https://dev.to/vivek96_/efficient-dom-manipulation-with-documentcreatedocumentfragment-54i6</link>
      <guid>https://dev.to/vivek96_/efficient-dom-manipulation-with-documentcreatedocumentfragment-54i6</guid>
      <description>&lt;p&gt;When working with the Document Object Model (DOM) in web development, efficient manipulation of DOM elements can significantly impact the performance of your web applications. One of the tools that can help you achieve more efficient DOM manipulation is &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;. In this article, we will explore the problem with the traditional approach to DOM manipulation and the benefits of using &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with Traditional DOM Manipulation
&lt;/h2&gt;

&lt;p&gt;In the traditional approach to DOM manipulation, developers often create a series of DOM elements and append them to the document one by one. While this approach is straightforward, it can lead to performance issues, especially when adding a large number of elements to the DOM. The key problems with this approach are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Frequent Reflows and Repaints&lt;br&gt;
Each time you append an element to the document, the browser performs a reflow and a repaint operation. A reflow calculates the layout and position of elements in the DOM, and a repaint updates the visual representation of the page. These operations can be computationally expensive, and when performed frequently, they can lead to a noticeable degradation in performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increased JavaScript Execution Time&lt;br&gt;
Appending multiple elements one by one in the traditional way requires a series of JavaScript function calls. Each call comes with a certain level of overhead, and the cumulative effect can lead to increased JavaScript execution time, causing slower response times in your web application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduced Responsiveness&lt;br&gt;
The user experience can suffer when a web page becomes less responsive due to slow DOM manipulation. Long-running JavaScript operations can make the page appear unresponsive or even freeze, negatively impacting user engagement.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Benefits of &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;To address these problems, the DOM API provides a helpful tool called &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;. This method allows developers to create a lightweight, in-memory container for storing and manipulating DOM elements before appending them to the actual document. The benefits of using &lt;code&gt;document.createDocumentFragment()&lt;/code&gt; include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Minimized Reflows and Repaints&lt;br&gt;
With a DocumentFragment, you can construct your desired DOM structure without affecting the document's layout and rendering performance. You can append child nodes to the DocumentFragment without triggering reflows and repaints. Only when you append the entire DocumentFragment to the document do the reflow and repaint operations occur, which can significantly reduce their frequency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved Performance&lt;br&gt;
By building and manipulating your DOM structure within a DocumentFragment, you reduce the number of reflows and repaints in the browser, resulting in better performance. The reduced computational overhead leads to a smoother and more responsive user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simpler Code&lt;br&gt;
Using &lt;code&gt;document.createDocumentFragment()&lt;/code&gt; often leads to more concise and readable code. You can structure your DOM manipulation logic within the DocumentFragment, making it easier to manage and understand, especially when dealing with a complex hierarchy of elements.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Use &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here's a simple example of how to use &lt;code&gt;document.createDocumentFragment()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Create a DocumentFragment&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fragment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createDocumentFragment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Create some DOM elements and add them to the fragment&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;div1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;div1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Element 1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;fragment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;div1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;div2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;div2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Element 2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;fragment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;div2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Append the entire fragment to the document&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fragment&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we create a DocumentFragment, add two &lt;code&gt;div&lt;/code&gt; elements to it, and then append the entire fragment to the document. This approach minimizes reflows and repaints, resulting in improved performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Efficient DOM manipulation is crucial for creating high-performance web applications. &lt;code&gt;document.createDocumentFragment()&lt;/code&gt; is a valuable tool that allows developers to construct and manipulate DOM elements without causing unnecessary reflows and repaints. By using DocumentFragments, you can improve the performance, responsiveness, and readability of your code, enhancing the overall user experience on your website or web application. Consider incorporating this technique into your web development toolkit to achieve more efficient DOM manipulation.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding the Difference Between compose() and pipe() in JavaScript</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Thu, 26 Oct 2023 02:44:13 +0000</pubDate>
      <link>https://dev.to/vivek96_/understanding-the-difference-between-compose-and-pipe-in-javascript-11ji</link>
      <guid>https://dev.to/vivek96_/understanding-the-difference-between-compose-and-pipe-in-javascript-11ji</guid>
      <description>&lt;p&gt;JavaScript is a versatile and expressive language that allows developers to manipulate data and create complex functions. In functional programming, two essential concepts for data transformation and function composition are &lt;code&gt;compose&lt;/code&gt; and &lt;code&gt;pipe&lt;/code&gt;. Both of these functions are used to combine multiple functions to create new, more complex functions. However, they differ in the order in which they execute the functions and their overall behavior. In this article, we'll explore the differences between &lt;code&gt;compose&lt;/code&gt; and &lt;code&gt;pipe&lt;/code&gt; in JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Basics of Compose and Pipe
&lt;/h2&gt;

&lt;p&gt;Before delving into the differences, let's first understand what compose and pipe are and how they work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compose
&lt;/h2&gt;

&lt;p&gt;compose is a function often found in functional programming libraries like Ramda or Lodash. It takes multiple functions as arguments and returns a new function that is the composition of those functions. The order of composition is from right to left, meaning that the rightmost function is executed first, and its result is passed as an argument to the next function to its left.&lt;/p&gt;

&lt;p&gt;Here's how compose works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const compose = (...functions) =&amp;gt; input =&amp;gt; functions.reduceRight((acc, fn) =&amp;gt; fn(acc), input);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pipe
&lt;/h2&gt;

&lt;p&gt;pipe is quite similar to compose in its purpose, but it differs in execution order. It also takes multiple functions as arguments and returns a new function, but the execution order is from left to right. In other words, the leftmost function is executed first, and its result is passed as an argument to the next function to its right.&lt;/p&gt;

&lt;p&gt;Here's how pipe works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const pipe = (...functions) =&amp;gt; input =&amp;gt; functions.reduce((acc, fn) =&amp;gt; fn(acc), input);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Differences
&lt;/h2&gt;

&lt;p&gt;Now that we understand how compose and pipe work, let's dive into the key differences between them:&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution Order
&lt;/h2&gt;

&lt;p&gt;The most significant difference between compose and pipe is the order in which they execute the functions. Compose executes functions from right to left, while pipe executes functions from left to right. This order can have a profound impact on the output of the composed function.&lt;/p&gt;

&lt;p&gt;For example, consider the following functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addTwo = x =&amp;gt; x + 2;
const double = x =&amp;gt; x * 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;compose&lt;/code&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 composedFunc = compose(double, addTwo);
composedFunc(3); // Output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;pipe&lt;/code&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 pipedFunc = pipe(addTwo, double);
pipedFunc(3); // Output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the compose example, addTwo is applied first, followed by double, resulting in 10. In the pipe example, addTwo is applied first, resulting in 5, and then double is applied, resulting in 10.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;The choice between compose and pipe depends on the specific use case and the order in which you want to apply your functions. Compose is often used when you want to apply functions from right to left, which can be useful when you have a series of transformations or filters that you want to apply in a particular order.&lt;/p&gt;

&lt;p&gt;Pipe, on the other hand, is ideal when you want to apply functions from left to right. This can be helpful when you want to build up a transformation step by step, where the output of each function is fed into the next one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Readability
&lt;/h2&gt;

&lt;p&gt;Another consideration is code readability. Depending on the situation, one of the functions might make your code more readable than the other. If you find that one order of function application makes the code more intuitive and easier to understand, it's advisable to use that approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In JavaScript, compose and pipe are powerful tools for function composition, enabling you to create complex functions from simpler ones. The main difference between them lies in the order in which they execute the functions, with compose working from right to left and pipe working from left to right. Choosing between the two depends on your specific use case and readability preferences. Understanding these differences will help you write more efficient and maintainable code in your JavaScript applications.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>An In-Depth Guide to HTTP Methods for frontend developers</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Wed, 18 Oct 2023 03:12:07 +0000</pubDate>
      <link>https://dev.to/vivek96_/an-in-depth-guide-to-http-methods-for-frontend-developers-2men</link>
      <guid>https://dev.to/vivek96_/an-in-depth-guide-to-http-methods-for-frontend-developers-2men</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the World Wide Web. It's the protocol that enables your web browser to fetch and display web pages, and it's used for many other purposes, including RESTful API interactions. HTTP methods, also known as HTTP verbs, play a crucial role in this protocol, defining the actions a client can perform on a resource. In this article, we will explore the various HTTP methods and their uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP Methods: A Brief Overview
&lt;/h2&gt;

&lt;p&gt;HTTP defines several methods, each with a specific purpose. These methods provide a standardized way for clients, such as web browsers or applications, to interact with web servers. Here are some of the most common HTTP methods:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET:&lt;/strong&gt; The GET method is used to request data from a specified resource. When you enter a URL in your browser, it sends a GET request to the server, which then responds with the requested web page. GET requests are typically read-only and should not have any side effects on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POST:&lt;/strong&gt; The POST method is used to submit data to be processed by a resource. It's commonly used when you submit a form on a web page. POST requests can have side effects, such as creating a new resource or updating existing data on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PUT:&lt;/strong&gt; The PUT method is used to update a resource or create it if it doesn't exist. Unlike POST, which might have side effects, a PUT request is idempotent, meaning that making the same request multiple times has the same result as making it once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PATCH:&lt;/strong&gt; The PATCH method is used to apply partial modifications to a resource. It's often used to update specific fields within an existing resource, without affecting the rest of the resource's data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DELETE:&lt;/strong&gt; The DELETE method is used to request the removal of a resource. It's a way to delete data on the server. Like PUT, DELETE requests are idempotent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HEAD:&lt;/strong&gt; The HEAD method is similar to GET but doesn't return the response body. It's used to retrieve metadata about a resource, such as headers, without transferring the actual data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OPTIONS:&lt;/strong&gt; The OPTIONS method is used to request information about the communication options available for a resource. It's often used to check the server's capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONNECT:&lt;/strong&gt; The CONNECT method is primarily used to establish a network connection to a resource, typically for the purpose of setting up a tunnel for secure communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TRACE:&lt;/strong&gt; The TRACE method is used for diagnostic purposes, allowing clients to see what changes have been made to a resource as it's been passed through intermediaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Use Cases
&lt;/h2&gt;

&lt;p&gt;Each HTTP method serves a specific purpose and is suitable for various use cases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GET:&lt;/strong&gt; Retrieving web pages, fetching data, or reading information from a server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;POST:&lt;/strong&gt; Submitting forms, sending data for processing, or creating new resources on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PUT:&lt;/strong&gt; Updating resources on the server, including replacing the entire resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PATCH:&lt;/strong&gt; Making partial updates to resources, such as modifying specific fields in a database record.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DELETE:&lt;/strong&gt; Removing resources from the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Understanding HTTP methods is fundamental for web developers and anyone working with web services. These methods dictate how clients interact with servers, making it possible to retrieve, modify, and delete resources while maintaining a standardized and secure approach.&lt;/p&gt;

&lt;p&gt;When developing web applications or working with RESTful APIs, it's essential to choose the appropriate HTTP method for the task at hand. GET, POST, PUT, PATCH, DELETE, and the other HTTP methods each have their own role and implications. Properly using these methods ensures efficient and reliable communication between clients and servers, contributing to the overall functionality and security of web-based systems.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>html</category>
    </item>
    <item>
      <title>Understanding Object.seal(), Object.freeze(), and Object.preventExtensions() in JavaScript</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Sun, 15 Oct 2023 10:01:51 +0000</pubDate>
      <link>https://dev.to/vivek96_/objectseal-objectfreeze-and-objectpreventextensions-in-javascript-4c3k</link>
      <guid>https://dev.to/vivek96_/objectseal-objectfreeze-and-objectpreventextensions-in-javascript-4c3k</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;JavaScript is a versatile and powerful programming language, known for its ability to manipulate and manage objects. Three essential methods for controlling the mutability of objects in JavaScript are &lt;code&gt;Object.seal()&lt;/code&gt;, &lt;code&gt;Object.freeze()&lt;/code&gt;, and &lt;code&gt;Object.preventExtensions()&lt;/code&gt;. These methods play a crucial role in ensuring the integrity and immutability of objects, providing developers with the tools they need to maintain data consistency and security. In this article, we'll explore each of these methods in detail and understand their use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Object.seal()
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Object.seal()&lt;/code&gt; method is used to seal an object, which means that it prevents the addition or removal of properties from that object. It also makes all existing properties non-configurable, meaning they cannot be reconfigured or deleted. However, the values of the existing properties can still be modified.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sealedObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sealedObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Adding a new property is not allowed&lt;/span&gt;
&lt;span class="nx"&gt;sealedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;New York&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;

&lt;span class="c1"&gt;// Deleting properties is not allowed&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;sealedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;

&lt;span class="c1"&gt;// Modifying existing properties is allowed&lt;/span&gt;
&lt;span class="nx"&gt;sealedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jane&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use cases for &lt;code&gt;Object.seal()&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you want to prevent the addition or deletion of properties, but still allow property value changes.&lt;/li&gt;
&lt;li&gt;Ensuring that certain properties remain consistent and unaltered throughout the object's lifetime.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Object.freeze()
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Object.freeze()&lt;/code&gt; method takes the concept of immutability a step further. When you freeze an object, it becomes completely immutable. This means that not only can you not add or delete properties, but you also cannot modify the values of existing properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;frozenObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Alice&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;freeze&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;frozenObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Adding a new property is not allowed&lt;/span&gt;
&lt;span class="nx"&gt;frozenObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Paris&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;

&lt;span class="c1"&gt;// Deleting properties is not allowed&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;frozenObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;

&lt;span class="c1"&gt;// Modifying existing properties is not allowed&lt;/span&gt;
&lt;span class="nx"&gt;frozenObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use cases for &lt;code&gt;Object.freeze()&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you need to create objects with constant, unchanging data.&lt;/li&gt;
&lt;li&gt;Ensuring that data remains consistent and cannot be unintentionally modified.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Object.preventExtensions()
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Object.preventExtensions()&lt;/code&gt; method is used to prevent the addition of new properties to an object. While it doesn't affect the configurability or writability of existing properties like &lt;code&gt;Object.seal()&lt;/code&gt;, it stops the object from being extended with new properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;extendedObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Eve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventExtensions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;extendedObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Adding a new property is not allowed&lt;/span&gt;
&lt;span class="nx"&gt;extendedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Berlin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Error&lt;/span&gt;

&lt;span class="c1"&gt;// Deleting properties is allowed&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;extendedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Modifying existing properties is allowed&lt;/span&gt;
&lt;span class="nx"&gt;extendedObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Charlie&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use cases for &lt;code&gt;Object.preventExtensions()&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you want to prevent new properties from being accidentally added to an object while still allowing modification and deletion of existing properties.&lt;/li&gt;
&lt;li&gt;Ensuring that an object has a fixed set of properties without any extensions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In JavaScript, the &lt;code&gt;Object.seal()&lt;/code&gt;, &lt;code&gt;Object.freeze()&lt;/code&gt;, and &lt;code&gt;Object.preventExtensions()&lt;/code&gt; methods provide developers with ways to control the mutability of objects, based on their specific requirements. By applying these methods appropriately, you can enhance the security and stability of your code, reduce the risk of unintentional data changes, and ensure that your objects behave as expected throughout their lifecycle. Understanding when and how to use these methods is essential for mastering JavaScript's object manipulation capabilities.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Unveiling Interaction to Next Paint (INP): A Vital Web Metric</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Tue, 10 Oct 2023 13:26:10 +0000</pubDate>
      <link>https://dev.to/vivek96_/unveiling-interaction-to-next-paint-inp-a-vital-web-metric-16g6</link>
      <guid>https://dev.to/vivek96_/unveiling-interaction-to-next-paint-inp-a-vital-web-metric-16g6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the ever-evolving landscape of web development and user experience, metrics like Core Web Vitals have gained immense importance. These metrics provide insights into how users perceive the speed and usability of a website, which can significantly impact its success. One such metric that has emerged as a critical indicator of user experience is &lt;strong&gt;&lt;em&gt;"Interaction to Next Paint"&lt;/em&gt;&lt;/strong&gt; (INP). INP is a component of the larger set of Core Web Vitals and is designed to measure the time it takes for a webpage to become interactive after the user's initial interaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding INP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To comprehend INP, it's essential to break down its name. "Interaction" refers to any user-initiated action on a webpage, such as clicking a link, tapping a button, or scrolling. "Next Paint" refers to the moment when the browser begins rendering the next visible frame, essentially indicating that the webpage is responding to the user's interaction. INP measures the time between these two events, providing web developers with a crucial metric to assess the responsiveness of their websites.&lt;/p&gt;

&lt;p&gt;INP is part of the Core Web Vitals initiative, which aims to provide a set of metrics that reflect the real-world user experience when interacting with web pages. Other components of Core Web Vitals include Largest Contentful Paint (LCP) and First Input Delay (FID), which together provide a comprehensive picture of web performance and user satisfaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why INP Matters&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Experience:&lt;/strong&gt; A website's responsiveness directly impacts the user experience. Slow interaction times can lead to user frustration, decreased engagement, and higher bounce rates. INP helps developers identify areas where improvements are needed to enhance user satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SEO Rankings:&lt;/strong&gt; Search engines, particularly Google, consider web vitals like INP as a ranking factor. Websites with better performance are more likely to rank higher in search results, leading to increased organic traffic and visibility.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Conversion Rates:&lt;/strong&gt; Slow INP can adversely affect conversion rates, especially on e-commerce websites. Users are more likely to abandon their shopping carts or leave a site if they experience delays when interacting with it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Competitive Advantage:&lt;/strong&gt; Websites that prioritize user experience and achieve better INP scores can gain a competitive edge in their respective niches. Improved performance can lead to increased user loyalty and positive word-of-mouth.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Improving INP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To improve INP scores and enhance overall website performance, web developers can consider the following strategies:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficient Code:&lt;/strong&gt; Optimize the website's codebase to reduce unnecessary processing and rendering times. Minimize JavaScript execution, eliminate render-blocking resources, and utilize browser caching effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content Delivery Network (CDN):&lt;/strong&gt; Implement a CDN to deliver content to users from servers geographically closer to them, reducing latency and improving response times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lazy Loading:&lt;/strong&gt; Implement lazy loading for non-essential resources such as images and videos, ensuring that only the necessary content loads initially.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prioritize Critical Resources:&lt;/strong&gt; Load critical resources first to ensure a faster initial rendering and interaction time for users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server Response Time:&lt;/strong&gt; Improve server response times by optimizing database queries, utilizing content compression, and employing efficient server-side caching.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://web.dev/inp/" rel="noopener noreferrer"&gt;Interaction to Next Paint (INP)&lt;/a&gt; is a vital web metric that plays a significant role in user experience, SEO rankings, and overall website success. Web developers and site owners should prioritize INP optimization as part of their broader strategy to improve Core Web Vitals. By focusing on reducing the time between user interactions and the subsequent rendering of the webpage, they can enhance user satisfaction, increase conversions, and gain a competitive edge in the digital landscape. As the web continues to evolve, INP will remain a critical indicator of a website's performance and its ability to meet user expectations.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Choosing the right JS framework for your next project is now easy!</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Sun, 29 Jan 2023 15:43:24 +0000</pubDate>
      <link>https://dev.to/vivek96_/choosing-the-right-js-framework-for-your-next-project-is-now-easy-4dke</link>
      <guid>https://dev.to/vivek96_/choosing-the-right-js-framework-for-your-next-project-is-now-easy-4dke</guid>
      <description>&lt;p&gt;JavaScript (JS) is one of the coolest and most used programming language which tops the charts as the most popular technology with over 65% of developer using it for development according to the &lt;a href="https://survey.stackoverflow.co/2022/#technology-most-popular-technologies" rel="noopener noreferrer"&gt;StackOverflow Developer Survey 2022&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07mfse2eofss4887r25t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07mfse2eofss4887r25t.png" alt="Stack overflow 2022 survey" width="800" height="1120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Does you and your team find it difficult in choosing the right JS framework for your next project? Do you spend more time in deciding the right framework more than you should’ve been? &lt;br&gt;
If the answer to these questions is YES, then my friend this article is for you.&lt;/p&gt;

&lt;p&gt;In this article, I’ll help you in deciding your perfect JS framework for your next project.&lt;/p&gt;

&lt;p&gt;What we’ll be going through?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What are the core features the framework offers?&lt;/li&gt;
&lt;li&gt;How popular is the JS framework and is it actively developed?&lt;/li&gt;
&lt;li&gt;Does the framework provide good documentation?&lt;/li&gt;
&lt;li&gt;Can you find enough learning resources on the framework?&lt;/li&gt;
&lt;li&gt;Does the framework integrate well with third-party tools?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. What are the core features the framework offers?
&lt;/h2&gt;

&lt;p&gt;Go through the documentation well and know the core features the framework has to offer. Is the framework only a view layer or is it fully-fledged?&lt;/p&gt;

&lt;p&gt;Apart from this there are other following features that you should look for in a framework:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Templating&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;State Management&lt;/li&gt;
&lt;li&gt;Forms integration and validations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the summary of the core features of the four popular JS frameworks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F68267os4ggory6i4ya29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F68267os4ggory6i4ya29.png" alt="Core features comparison for Angular, React, Ember, Vue" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How popular is the JS framework and is it actively developed?
&lt;/h2&gt;

&lt;p&gt;This is one of the key points to remember while selecting the right framework. Imagine a scenario where you’re liking the idea of staying at a hotel nearby beach on a vacation but your travel buddies are more inclined towards staying at the centre of the city as its got some good reputed hotels.&lt;/p&gt;

&lt;p&gt;The same works for JS frameworks. You might like a framework but your colleagues and the client are more into choosing a well reputed framework. Here are some points as to why they’re right:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If the framework is supported by less number of developers, then you’ll have to abandon the project midway or have to start from scratch with another framework.&lt;/li&gt;
&lt;li&gt;Once your project grows and you need more developers to work on it, then it might be difficult to find a developer who’s got the core knowledge of that framework.&lt;/li&gt;
&lt;li&gt;If you’re working with a less popular framework, then the chances are that it’s got a small community which might be a blocker for you because you’re unable to find the solution to the issue.&lt;/li&gt;
&lt;li&gt;Nevertheless, if you want to receive better opportunities in future, then mastering a popular framework will help you get your dream job faster.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can determine the popularity of the framework by quickly looking at how well the project is doing on Github.&lt;/p&gt;

&lt;p&gt;Here are the popularity statistics for the four popular frameworks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fza9bjn2x0p49y8zizoz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fza9bjn2x0p49y8zizoz3.png" alt="Popularity statistics comparison for Angular, React, Ember, Vue" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Does the framework provide good documentation?
&lt;/h2&gt;

&lt;p&gt;While going through a new codebase just after you’ve joined an organisation, you might find it difficult to understand especially if it's a legacy code and not properly documented. You might feel frustrated and have to depend on others to help you understand the code which was written way back.&lt;/p&gt;

&lt;p&gt;Same happens with the frameworks, you’re always reading and implementing someone else’s code. So choosing the right framework which is well documented with proper examples can help you utilise the framework to its full potential.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Can you find enough learning resources on the framework?
&lt;/h2&gt;

&lt;p&gt;Documentation can help you understand the framework upto some extent. For mastering the framework you’ll be relying on other resources as well such as video tutorials, articles, books, etc.&lt;/p&gt;

&lt;p&gt;So whenever you’re choosing a framework, always go through the internet to check if there are enough resources available. If there are not much resources available then either the framework is new or it’s not maintained anymore. If you decide to go forward with these kind of frameworks then they might hurt you in the long run and you’ll be in deep waters.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Does the framework integrate well with third-party tools?
&lt;/h2&gt;

&lt;p&gt;A framework itself is not enough. Even a feature rich JS framework will require additional tools. Third-party tools can help you solve the problems which the framework itself cannot solve such as DOM manipulation, rich text editing, date time formatting, state manipulation. However these tools and libraries won’t even matter if you can’t integrate them with the chosen framework.&lt;/p&gt;

&lt;p&gt;Somehow if you’re able to integrate the tools but that’s costing you a lot of time then you’ll be in deep trouble. Hence, the ease of integration should be tested before choosing the framework.&lt;/p&gt;

&lt;p&gt;For example, you can directly install libraries using npm for React.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope this information is what you need and will help you make a wise decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://survey.stackoverflow.co/2022/#technology-most-popular-technologies" rel="noopener noreferrer"&gt;https://survey.stackoverflow.co/2022/#technology-most-popular-technologies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.toptal.com/javascript/choosing-best-front-end-framework" rel="noopener noreferrer"&gt;https://www.toptal.com/javascript/choosing-best-front-end-framework&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>development</category>
      <category>discuss</category>
    </item>
    <item>
      <title>7 different JavaScript console methods you never knew existed 🤯</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Sat, 28 Jan 2023 12:01:14 +0000</pubDate>
      <link>https://dev.to/vivek96_/7-different-javascript-console-methods-you-never-knew-existed-131k</link>
      <guid>https://dev.to/vivek96_/7-different-javascript-console-methods-you-never-knew-existed-131k</guid>
      <description>&lt;p&gt;So being a JavaScript developer whenever I have to debug my code, the first thing that comes to my mind is adding a console.log(). Is this the only way of debugging using a console object? Why all my console data looks similar? What if I can add some colors to my console data? What if I can organize my data correctly?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UGHHH!!!!&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  JavaScript console methods to the rescue
&lt;/h2&gt;

&lt;p&gt;Apart from the &lt;em&gt;&lt;strong&gt;log()&lt;/strong&gt;&lt;/em&gt; method, the console object provides us with some more useful methods which we can use to boost our productivity and take our debugging skills to the next level. So in this article, we’ll briefly understand 7 of the many different JavaScript console methods that remain hidden to most of the developers.&lt;/p&gt;




&lt;h2&gt;
  
  
  #1 console.table()
&lt;/h2&gt;

&lt;p&gt;You as a developer must have put an array or object inside a &lt;strong&gt;&lt;em&gt;console.log()&lt;/em&gt;&lt;/strong&gt; . Well there’s a better way of doing it by using &lt;strong&gt;&lt;em&gt;console.table()&lt;/em&gt;&lt;/strong&gt; which will structure your code for better readability. You can also sort your table in any way you like without adding any extra piece of code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focq846ac7sdt8tenvcwh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focq846ac7sdt8tenvcwh.png" alt="console.table code" width="800" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Output&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3dwlk9v8n8ff29w955l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3dwlk9v8n8ff29w955l.png" alt="console.table output" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #2 console.assert()
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;console.assert()&lt;/em&gt;&lt;/strong&gt; comes in handy when you want to print some data on the basis of a certain condition, if the assertion is false then it’ll be printed otherwise nothing will be printed in case it’s true.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngonyw8my9xx9sm91x6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngonyw8my9xx9sm91x6m.png" alt="console.assert code" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uk4okty0k4pmp36ukrm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uk4okty0k4pmp36ukrm.png" alt="console.assert output" width="788" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #3 console.dir()
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;console.dir()&lt;/em&gt;&lt;/strong&gt; displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects. This method is very much similar to &lt;strong&gt;&lt;em&gt;console.log()&lt;/em&gt;&lt;/strong&gt; but the key difference is visible when we start playing with DOM nodes. &lt;strong&gt;&lt;em&gt;console.log()&lt;/em&gt;&lt;/strong&gt; prints the element in an HTML-like tree while &lt;strong&gt;&lt;em&gt;console.dir()&lt;/em&gt;&lt;/strong&gt; prints the element in a JSON-like tree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;console.log()&lt;/em&gt;&lt;/strong&gt; gives special treatment to DOM elements, whereas &lt;strong&gt;&lt;em&gt;console.dir()&lt;/em&gt;&lt;/strong&gt; does not. This is often useful when trying to see the full representation of the DOM object.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9hz9tww7ciakt09crz5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9hz9tww7ciakt09crz5e.png" alt="console.dir code and output" width="800" height="854"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #4 console.count()
&lt;/h2&gt;

&lt;p&gt;Let’s say you want to see how many times a certain part of your code is being run, &lt;strong&gt;&lt;em&gt;console.count()&lt;/em&gt;&lt;/strong&gt; can help you out as it prints the number of times a part of your code for example a function runs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8sauar36m5g3y4a1kux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8sauar36m5g3y4a1kux.png" alt="console.count code" width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66z9mfhece6p580rr164.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66z9mfhece6p580rr164.png" alt="console.count output" width="673" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #5 console.time()
&lt;/h2&gt;

&lt;p&gt;To become a better JavaScript developer, one should understand the performance impact of different types of loops. &lt;strong&gt;&lt;em&gt;console.time()&lt;/em&gt;&lt;/strong&gt; can help you as it prints the amount of time taken by a particular section of your code to execute.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffn5uflcaeimxg6p7f8zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffn5uflcaeimxg6p7f8zc.png" alt="console.time code" width="800" height="745"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr8z0rmy6fef2s5we6a34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr8z0rmy6fef2s5we6a34.png" alt="console.time output" width="666" height="34"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #6 console.group()
&lt;/h2&gt;

&lt;p&gt;This method is helpful when you want to group your console data which is similar. We can even do nesting and show relationship among them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftaw3hjszw3oyglldxg5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftaw3hjszw3oyglldxg5g.png" alt="console.group code" width="800" height="905"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92qk88co0j020l14czvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F92qk88co0j020l14czvb.png" alt="console.group output" width="761" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  #7 console.trace()
&lt;/h2&gt;

&lt;p&gt;Dealing with bugs in a large and complex codebase where you don’t exactly know the root cause of it can quickly become frustrating and time consuming. Understanding the &lt;code&gt;code execution flow&lt;/code&gt; can help you quickly deal with those bugs and &lt;strong&gt;&lt;em&gt;console.trace()&lt;/em&gt;&lt;/strong&gt; helps you deal with those bugs better.&lt;/p&gt;

&lt;p&gt;In simple terms it logs to the console the call stack that exists at the point &lt;strong&gt;&lt;em&gt;console.trace()&lt;/em&gt;&lt;/strong&gt; is called.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Code&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F661koy7rcs4s6fzaub8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F661koy7rcs4s6fzaub8w.png" alt="console.trace code" width="800" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqvevry2dl58ds1tavok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqvevry2dl58ds1tavok.png" alt="console.trace output" width="754" height="139"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;This isn’t everything. There’s so many other console methods that you can read about and leverage them in your projects and become &lt;strong&gt;&lt;em&gt;super productive&lt;/em&gt;&lt;/strong&gt;. If you’ve come to this point then I’d invite you to discover more ways to leverage browser DevTools to their full potential. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/console" rel="noopener noreferrer"&gt;console - Web APIs | MDN (mozilla.org)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.chrome.com/docs/devtools/console/api/" rel="noopener noreferrer"&gt;Console API reference - Chrome Developers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How I built my portfolio using Next.js, TailwindCSS, TypeScript and Framer Motion</title>
      <dc:creator>Vivek Mittal</dc:creator>
      <pubDate>Mon, 21 Mar 2022 11:29:49 +0000</pubDate>
      <link>https://dev.to/vivek96_/how-i-built-my-portfolio-using-nextjs-tailwindcss-typescript-and-framer-motion-274e</link>
      <guid>https://dev.to/vivek96_/how-i-built-my-portfolio-using-nextjs-tailwindcss-typescript-and-framer-motion-274e</guid>
      <description>&lt;p&gt;By mid february'22 while serving my notice period I decided to migrate my portfolio from CRA to next.js and also gave a thought about adding the blogs to my own &lt;a href="https://vivekmittal.vercel.app" rel="noopener noreferrer"&gt;portfolio website&lt;/a&gt;. So I decided to go with the following tech stack listed below:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;Framer Motion&lt;/li&gt;
&lt;li&gt;TailwindCSS&lt;/li&gt;
&lt;li&gt;SendGrid&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next.js
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt; is a production ready framework for &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React&lt;/a&gt;. It comes with some great features out of the box like SSR/SSG/ISR, route pre-fetching, file system based routing, and most importantly SEO. So when I created my portfolio with CRA the TypeScript support is not good along with poor SEO. The need to have a separate backend server just to make your contact form working was a nightmare (if one is not using &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;).&lt;br&gt;
Due to all the above problems I decided to go with Next.js&lt;/p&gt;

&lt;h2&gt;
  
  
  TypeScript
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.typescriptlang.org/" rel="noopener noreferrer"&gt;TypeScript&lt;/a&gt; is a superset of JavaScript which provides optional typing and compiles down to JavaScript. While working with JavaScript I would occasionally struggle with type of a variable/object or any data type. That's where TypeScript comes to the rescue and let's us make our application type safe from the beginning itself.&lt;br&gt;
Once you're introduced with TypeScript, you will never go back to writing JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Framer Motion
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.framer.com/motion/" rel="noopener noreferrer"&gt;Framer Motion&lt;/a&gt; is a production ready animation library for React. I felt the need to add some "cool" animations to my portfolio so that it looks more alive and interactive. One can argue between choosing &lt;a href="https://react-spring.io/" rel="noopener noreferrer"&gt;React Spring&lt;/a&gt; or &lt;a href="https://github.com/chenglou/react-motion" rel="noopener noreferrer"&gt;React Motion&lt;/a&gt; but that depends on the use-case and since I've already worked with Framer motion before so I went with this.&lt;/p&gt;

&lt;h2&gt;
  
  
  TailwindCSS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;TailwindCSS&lt;/a&gt; is a utility first CSS framework which is highly customisable and can be optimised using PurgeCSS. It helps in building complex responsive layouts easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  SendGrid
&lt;/h2&gt;

&lt;p&gt;So I've a contact form in my portfolio website and I was going to host it on &lt;a href="https://vercel.com/" rel="noopener noreferrer"&gt;Vercel&lt;/a&gt; and not Netlify so I was in need of an emailing service to work flawlessly with my contact form which can be customised according to my needs as well. Then I did some research and came across &lt;a href="https://sendgrid.com/" rel="noopener noreferrer"&gt;SendGrid&lt;/a&gt; which can be easily integrated with Next.js (thanks to the ability of Next.js to add server code) and decided to use this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Miscellaneous
&lt;/h2&gt;

&lt;p&gt;There are some other packages such as remark-prism, react-toastify, react-icons and next-pwa which I used to add syntax highlighting, notifications, icons and make my application a progressive web app (PWA) respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion and what's next?
&lt;/h2&gt;

&lt;p&gt;It took me around 2 weeks on and off to complete my portfolio website.&lt;br&gt;
Down the road, I'll add sitemap, optimise it further for mobile devices, add reactions to blog-posts, add a CDN to serve static-images and maybe use a CMS to store and fetch all my blogs/projects data.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>portfolio</category>
    </item>
  </channel>
</rss>
