<?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: vicky-ops</title>
    <description>The latest articles on DEV Community by vicky-ops (@vicky_ops).</description>
    <link>https://dev.to/vicky_ops</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%2F816346%2F1c437fd3-bcd5-4822-8dce-e57e40bba118.jpg</url>
      <title>DEV Community: vicky-ops</title>
      <link>https://dev.to/vicky_ops</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vicky_ops"/>
    <language>en</language>
    <item>
      <title>HAR Files: A Tester's Tool for Web Performance Insights</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Thu, 14 Sep 2023 18:10:45 +0000</pubDate>
      <link>https://dev.to/vicky_ops/har-files-a-testers-tool-for-web-performance-insights-411c</link>
      <guid>https://dev.to/vicky_ops/har-files-a-testers-tool-for-web-performance-insights-411c</guid>
      <description>&lt;p&gt;Testers play a vital role in ensuring a seamless user experience. One essential tool in our kit is the HAR file, or HTTP Archive file. It's a log format that reveals intricate details about how a web page loads and the interactions between a browser and server. Here's why HAR files matter:&lt;/p&gt;

&lt;p&gt;Performance Insights&lt;br&gt;
HAR files break down the loading process, showing timings for DNS resolution, connection, SSL/TLS handshakes, requests, waiting for responses, and content downloading. This helps identify bottlenecks.&lt;/p&gt;

&lt;p&gt;Network Troubleshooting&lt;br&gt;
When a web page doesn't load or behaves unexpectedly, HAR files provide a history of requests and error codes, aiding troubleshooting.&lt;/p&gt;

&lt;p&gt;Cookie Understanding&lt;br&gt;
HAR files contain cookie data, helping testers understand cookie usage and potential conflicts.&lt;/p&gt;

&lt;p&gt;Cache Analysis&lt;br&gt;
They also reveal cache hits and misses, allowing testers to optimize resource caching.&lt;/p&gt;

&lt;p&gt;Generating a HAR file is simple:&lt;/p&gt;

&lt;p&gt;Set up your environment with Selenium, a web driver, and selenium-har-util.&lt;/p&gt;

&lt;p&gt;Navigate to the web page of interest.&lt;/p&gt;

&lt;p&gt;Capture the HAR file by starting and stopping a network listener.&lt;/p&gt;

&lt;p&gt;Analyze the HAR file using tools or online viewers.&lt;/p&gt;

&lt;p&gt;HAR files empower testers to optimize load times and ensure a smooth user experience.&lt;/p&gt;

&lt;p&gt;Happy testing! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding the Bug Life Cycle in Software Testing</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Wed, 13 Sep 2023 15:35:44 +0000</pubDate>
      <link>https://dev.to/vicky_ops/understanding-the-bug-life-cycle-in-software-testing-3p8n</link>
      <guid>https://dev.to/vicky_ops/understanding-the-bug-life-cycle-in-software-testing-3p8n</guid>
      <description>&lt;p&gt;Before going into Bug life cycle, lets understand what a bug is and why does it even matter.&lt;/p&gt;

&lt;p&gt;What is a Bug?&lt;/p&gt;

&lt;p&gt;In simple terms, a bug is an anomaly or unexpected behavior in a software application. It's a flaw that can manifest in various ways, from a minor annoyance to a critical issue that renders the software unusable.&lt;/p&gt;

&lt;p&gt;Why Do Bugs Matter?&lt;/p&gt;

&lt;p&gt;Bugs matter because they can have a significant impact on the quality and reliability of a software product. They can cause crashes, data loss, security vulnerabilities, and user frustration. In today's competitive software landscape, where user experience is paramount, the presence of bugs can lead to loss of customers and damage to a company's reputation.&lt;/p&gt;

&lt;p&gt;Understanding the Bug Life Cycle:&lt;/p&gt;

&lt;p&gt;To effectively manage bugs and ensure they are resolved in a systematic manner, the software industry has established a Bug Life Cycle. This life cycle consists of several stages, each with a specific purpose and set of actions. Let's take a closer look at these stages:&lt;/p&gt;

&lt;p&gt;Discovery: Bugs are first discovered during various phases of software development and testing. This could be during unit testing, integration testing, or even after the software has been deployed.&lt;/p&gt;

&lt;p&gt;Logging: Once a bug is discovered, it needs to be logged or documented. This step involves creating a detailed report that includes information about the bug's symptoms, environment, and steps to reproduce it.&lt;/p&gt;

&lt;p&gt;Prioritization: Not all bugs are created equal. Some are critical and need immediate attention, while others may have lower priority. Prioritization helps in allocating resources efficiently.&lt;/p&gt;

&lt;p&gt;Assigned: Bugs are then assigned to the appropriate team members responsible for fixing them. This step ensures that the right people are aware of and working on the issue.&lt;/p&gt;

&lt;p&gt;Open: Bugs can have various statuses at this stage, such as:&lt;/p&gt;

&lt;p&gt;Duplicate: If a bug report duplicates an existing one.&lt;br&gt;
Rejected: If the reported issue is not a valid bug.&lt;br&gt;
Deferred: If the bug is acknowledged but scheduled for a later release.&lt;br&gt;
Not a bug: If the reported behavior is expected and not a bug.&lt;br&gt;
Fixed: Once a developer has addressed the bug, they mark it as "fixed" in the system.&lt;/p&gt;

&lt;p&gt;Retest: Testers then retest the software to verify that the bug has indeed been fixed and that no new issues have been introduced.&lt;/p&gt;

&lt;p&gt;Reopened (may be required): If the bug reappears or is not completely fixed, it may be reopened for further investigation.&lt;/p&gt;

&lt;p&gt;Verified: After successful retesting, the bug is marked as "verified."&lt;/p&gt;

&lt;p&gt;Closed: Finally, when a bug is resolved, verified, and no longer impacting the software, it is marked as "closed."&lt;/p&gt;

&lt;p&gt;In Summary:&lt;/p&gt;

&lt;p&gt;The Bug Life Cycle is a crucial process in software development and testing, aimed at ensuring that bugs are effectively managed and resolved. It provides a structured approach to bug tracking, from discovery to resolution, ultimately improving the quality and reliability of software products.&lt;/p&gt;

&lt;p&gt;In our ever-evolving software landscape, understanding and mastering the Bug Life Cycle is essential for delivering top-notch software that meets user expectations and maintains a positive reputation for your organization. So, next time you encounter a bug, remember that it's just one step in the journey towards delivering high-quality software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GY8tu_-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmhrpz03i1975jasy51b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GY8tu_-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmhrpz03i1975jasy51b.png" alt="Bug-life Cycle, Courtesy-javatpoint.com" width="600" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sdlc</category>
      <category>qualityassurace</category>
      <category>bug</category>
    </item>
    <item>
      <title>Verification and Validation in Quality Assurance</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Wed, 13 Sep 2023 15:27:22 +0000</pubDate>
      <link>https://dev.to/vicky_ops/verification-and-validation-in-quality-assurance-21ol</link>
      <guid>https://dev.to/vicky_ops/verification-and-validation-in-quality-assurance-21ol</guid>
      <description>&lt;p&gt;Verification and Validation are two essential assurance processes that are used to ensure a product, service, or system meets its requirements and specifications and that it fulfills its intended purpose.&lt;/p&gt;

&lt;p&gt;Verification Process includes checking documents, design, code, and program, Verification does not involve code Execution, Verification Uses methodss like reviews, walkthroughs, inspections, and desk-checking.&lt;/p&gt;

&lt;p&gt;Validation Process  includes testing an validation of the actual product, Validation involved code Execution, Validation  uses methods like black box testing, white box testing, functional and non-functional testing.&lt;/p&gt;

&lt;p&gt;Verification find the bugs early in the development cycle, Verification process targets software architecture, design, database, etc. It is done by QA team.&lt;/p&gt;

&lt;p&gt;Validation finds the bugs that verification can not catch, Validation process targets the actual software product,Validation is done by the involvement of the testing team with QA Team&lt;/p&gt;

&lt;p&gt;Verification process comes before validation, whereas valdation process comes after verificatio.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Guide to Root Cause Analsis - Understanding And Techniques</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Wed, 06 Sep 2023 08:21:07 +0000</pubDate>
      <link>https://dev.to/vicky_ops/guide-to-root-cause-analsis-understanding-and-techniques-1ln6</link>
      <guid>https://dev.to/vicky_ops/guide-to-root-cause-analsis-understanding-and-techniques-1ln6</guid>
      <description>&lt;p&gt;Root Cause Analysis (RCA) is a systematic process used to identify the underlying or fundamental causes of problems or issues rather than just addressing their symptoms. RCA is a valuable tool in various fields, including engineering, healthcare, quality management, and business, as it helps organizations prevent issues from recurring and make data-driven decisions for improvement. Here's a step-by-step guide to performing RCA:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Define the Problem:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Begin by clearly defining the problem or issue you want to investigate. Be specific about what happened, when it occurred, and its impact. A well-defined problem statement is crucial for a successful RCA.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Assemble a Team:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Form a cross-functional team with members who have relevant knowledge and expertise related to the problem. Including diverse perspectives can lead to a more comprehensive analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Gather Information:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collect all available data and information related to the problem. This may include incident reports, documents, records, and interviews with individuals involved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Identify Immediate Causes (Symptoms):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List the immediate causes or symptoms of the problem. These are the most apparent factors that contributed to the issue. Ask "Why did this happen?" and record the answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Ask "Why" Repeatedly (5 Whys or More):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For each immediate cause identified in step 4, ask "Why?" repeatedly to uncover deeper underlying causes. Continue this process iteratively until you reach a point where further questioning does not provide meaningful answers. Typically, five iterations are sufficient, but you may need more or fewer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Use RCA Tools:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Depending on the complexity of the problem, you can use various RCA tools and techniques, such as Fishbone Diagrams (Ishikawa or Cause-and-Effect Diagrams), Fault Tree Analysis (FTA), Failure Mode and Effects Analysis (FMEA), or Pareto Analysis, to visualize and analyze the causes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Analyze Data and Evidence:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examine the data and evidence collected during the investigation. Look for patterns, trends, and correlations among the identified causes. This helps in determining the most influential or critical causes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8. Determine the Root Cause:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The root cause is the fundamental factor or factors that, if addressed, would prevent the problem from occurring again. It is the primary reason behind all the immediate and contributing causes identified through the "Why" questioning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;9. Develop Corrective Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the root cause is identified, brainstorm and develop corrective actions to address it. These actions should eliminate or mitigate the root cause and prevent the problem's recurrence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;10. Implement and Monitor Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put the corrective actions into practice and monitor their effectiveness. Ensure that the changes made are sustainable and do not introduce new problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;11. Document the Process:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain detailed records of the entire RCA process, including the problem definition, causes identified, root cause determination, corrective actions, and their outcomes. This documentation is crucial for accountability and future reference.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;12. Continuous Improvement:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encourage a culture of continuous improvement by regularly reviewing and updating the RCA process. Use lessons learned from past analyses to enhance future problem-solving efforts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, organizations can systematically analyze and address problems at their core, leading to more effective and sustainable solutions, improved quality, and increased operational efficiency. Root Cause Analysis is an essential tool for continuous improvement and problem-solving across various industries.&lt;/p&gt;

</description>
      <category>qa</category>
      <category>rca</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Navigating the Software Testing Life Cycle (STLC): Ensuring Quality Throughout Development</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Fri, 25 Aug 2023 16:42:02 +0000</pubDate>
      <link>https://dev.to/vicky_ops/navigating-the-software-testing-life-cycle-stlc-ensuring-quality-throughout-development-150k</link>
      <guid>https://dev.to/vicky_ops/navigating-the-software-testing-life-cycle-stlc-ensuring-quality-throughout-development-150k</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br&gt;
In the dynamic world of software development, the Software Testing Life Cycle (STLC) is a foundational framework that ensures the reliability and quality of software applications. It's a well-structured approach that guides the rigorous testing process from start to finish. In this article, we'll delve into the crucial phases of STLC, discuss the entry and exit criteria, and highlight its critical role in modern software development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Phases of STLC:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Requirements Analysis&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In-Depth Requirement Analysis&lt;/strong&gt;: At this stage, the testing team conducts an in-depth analysis of the software requirements and specifications. The goal is to gain a comprehensive understanding of the system under development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope Definition&lt;/strong&gt;: Defining the testing scope is pivotal. It involves identifying the features that will be tested, ensuring nothing is overlooked.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Planning&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Detailed Test Plan&lt;/strong&gt;: Test planning involves the creation of a detailed test plan that leaves no stone unturned. It includes outlining the testing approach, objectives, test strategy, and schedules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Allocation&lt;/strong&gt;: Allocating the right resources is crucial for a successful testing phase. This stage also defines test environments, test data requirements, and the types of testing that will be performed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Design&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Comprehensive Test Cases&lt;/strong&gt;: Test design is where the rubber meets the road. Test cases and scenarios are meticulously designed based on the requirements and specifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thorough Coverage&lt;/strong&gt;: The focus is on covering every aspect, from functionality to performance, usability, security, and beyond.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Environment Setup&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setting Up the Perfect Environment&lt;/strong&gt;: A significant portion of testing success depends on setting up the ideal testing environment. This includes configuring hardware, software, and network settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Selection and Configuration&lt;/strong&gt;: Test tools and frameworks are carefully selected, installed, and configured to facilitate efficient testing.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Execution&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Putting Tests to the Test&lt;/strong&gt;: Test execution is where all the planning and design come to fruition. Testers execute the test cases, meticulously recording the results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regression Testing&lt;/strong&gt;: This phase includes crucial activities like regression testing, retesting, and smoke testing to ensure that recent changes haven't adversely affected existing functionality.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Defect Reporting and Tracking&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Defects in the Spotlight&lt;/strong&gt;: When defects are discovered during test execution, they are reported in a dedicated defect tracking system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: Testers and developers work together to resolve these defects, with clear communication regarding severity, priority, and steps to reproduce.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Closure&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Assessment and Reporting&lt;/strong&gt;: Test closure activities involve a comprehensive assessment of test results. It culminates in the creation of detailed test closure reports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process Improvement&lt;/strong&gt;: These reports serve as valuable tools for process improvement and future testing endeavors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Entry and Exit Criteria:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Entry Criteria&lt;/strong&gt;: Entry criteria specify the conditions that must be met before commencing a particular phase of STLC. For example, before embarking on test case development, requirements, a deep understanding of the application flow, and a finalized test plan must be in place.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exit Criteria&lt;/strong&gt;: Exit criteria outline the expectations that must be fulfilled before concluding a phase. To conclude the Test Case development phase, for instance, you should have completed test cases, identified test data, and, if applicable, ready automation scripts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Additional Considerations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Traceability&lt;/strong&gt;: Throughout the STLC, maintaining traceability is key. This means establishing links between test cases and requirements to ensure comprehensive coverage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regression Testing&lt;/strong&gt;: Regression testing is an ongoing process to detect any unintended side effects of recent changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automation&lt;/strong&gt;: In the modern software landscape, test automation is a powerful ally. It accelerates repetitive testing tasks and enhances efficiency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Metrics&lt;/strong&gt;: Metrics play a vital role in quality assessment. Key metrics include test coverage, defect density, and the effectiveness of test cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CI/CD&lt;/strong&gt;: With the advent of DevOps and Agile methodologies, testing is seamlessly integrated into the development process through Continuous Integration/Continuous Deployment (CI/CD) pipelines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Acceptance Testing&lt;/strong&gt;: Don't forget User Acceptance Testing (UAT), which involves testing the software with actual end-users to ensure it meets their needs and expectations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Defect Management&lt;/strong&gt;: Effective defect reporting and tracking are vital. This isn't just about finding defects but managing them through to resolution with clear communication between testing and development teams.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;In the complex and ever-evolving world of software development, the Software Testing Life Cycle (STLC) stands as a guardian of quality. It ensures that your software product meets the highest standards, irrespective of whether you follow a traditional Waterfall approach or embrace the agility of Agile and DevOps methodologies. A well-structured STLC is your compass, guiding you towards delivering software with unwavering confidence.&lt;/p&gt;

</description>
      <category>stlc</category>
      <category>qualityassurance</category>
      <category>softwaredevelopment</category>
      <category>softwaretesting</category>
    </item>
    <item>
      <title>Preparing for a Cypress Interview: Quickly brushing fundamental understanding</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Thu, 24 Aug 2023 17:51:58 +0000</pubDate>
      <link>https://dev.to/vicky_ops/preparing-for-a-cypress-interview-quickly-brushing-fundamental-understanding-3a8d</link>
      <guid>https://dev.to/vicky_ops/preparing-for-a-cypress-interview-quickly-brushing-fundamental-understanding-3a8d</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C_PVoutj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://encrypted-tbn0.gstatic.com/images%3Fq%3Dtbn:ANd9GcTordLYzGtlz8QJD6S7RauYBUYCTkUh0geto_ywGf53%26s" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C_PVoutj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://encrypted-tbn0.gstatic.com/images%3Fq%3Dtbn:ANd9GcTordLYzGtlz8QJD6S7RauYBUYCTkUh0geto_ywGf53%26s" alt="Cypress Logo" width="364" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Cypress?
&lt;/h3&gt;

&lt;p&gt;Cypress is an open-source JavaScript-based end-to-end testing framework for web applications. Unlike traditional testing tools, Cypress operates directly within the browser. This means it can observe and control your application in real-time, providing a unique set of features and benefits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;To get started with Cypress, you'll need Node.js installed. Then, simply run the following command to install Cypress as a development dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;cypress &lt;span class="nt"&gt;--save-dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Writing Your First Test
&lt;/h3&gt;

&lt;p&gt;Cypress tests are written in JavaScript. Let's create a basic test that visits a website and asserts the presence of an element.&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="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My First Test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Visits the homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
     &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Welcome to Example&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;be.visible&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;})&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:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Describe a test suite.&lt;/li&gt;
&lt;li&gt;Specify a test case.&lt;/li&gt;
&lt;li&gt;In the test case, visit a web page and assert that it contains the text "Welcome to Example."&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;p&gt;Cypress offers several features that make it a powerful testing tool:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time-Travel Debugging:&lt;/strong&gt; You can see every step taken in your test, making debugging a breeze.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Reloading:&lt;/strong&gt; As you make changes to your test code, Cypress instantly refreshes the test runner.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automatic Waiting:&lt;/strong&gt; Cypress automatically waits for elements to become available, eliminating flaky tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simple API:&lt;/strong&gt; Cypress provides an expressive API that simplifies writing tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Unit Testing vs. End-to-End Testing
&lt;/h3&gt;

&lt;p&gt;It's essential to distinguish between unit testing and end-to-end testing. Unit tests focus on testing individual components or functions in isolation, while end-to-end tests, performed with Cypress, simulate real user interactions with your application. Both types of testing are vital for ensuring a robust application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handling Asynchronous Tasks
&lt;/h3&gt;

&lt;p&gt;Cypress handles asynchronous code gracefully. It automatically waits for commands to complete. However, you can use &lt;code&gt;cy.wait()&lt;/code&gt; for explicit waits, and you can chain commands using &lt;code&gt;.then()&lt;/code&gt; to handle asynchronous code effectively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Integration
&lt;/h3&gt;

&lt;p&gt;Setting up Cypress in your Continuous Integration (CI) pipeline is straightforward. Install Cypress in your CI environment, configure your test script, and ensure that the necessary dependencies are available. Popular CI platforms like Jenkins, Travis CI, CircleCI, and GitHub Actions support Cypress.&lt;/p&gt;

&lt;h3&gt;
  
  
  Browser Support
&lt;/h3&gt;

&lt;p&gt;As of my last update in September 2021, Cypress primarily supports Chrome-based browsers. However, work on supporting other browsers like Firefox and Edge was in progress. Be sure to check the Cypress documentation or official website for the latest information on browser support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom Commands
&lt;/h3&gt;

&lt;p&gt;Custom commands in Cypress allow you to encapsulate commonly used sequences of actions into reusable functions, improving the maintainability of your test code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handling File Uploads
&lt;/h3&gt;

&lt;p&gt;Handling file uploads in Cypress tests is straightforward. Use the &lt;code&gt;cy.fixture()&lt;/code&gt; and &lt;code&gt;cy.get()&lt;/code&gt; commands to select a file and upload it to an input field on a web page. The Cypress documentation provides comprehensive guidance and examples for this task.&lt;/p&gt;

&lt;p&gt;In conclusion, Cypress is a robust and developer-friendly tool for end-to-end testing of web applications. Its unique features, simplicity, and real-time feedback make it an excellent choice for ensuring your web app functions flawlessly.&lt;/p&gt;

&lt;p&gt;Remember, the web development landscape evolves rapidly, and Cypress is no exception. Be sure to consult the official Cypress documentation and community resources for the latest updates and best practices.&lt;/p&gt;

&lt;p&gt;Happy testing!&lt;/p&gt;

</description>
      <category>cypress</category>
      <category>testing</category>
      <category>javascript</category>
      <category>automation</category>
    </item>
    <item>
      <title>Understanding Regression Testing vs. Retesting</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Mon, 21 Aug 2023 17:45:45 +0000</pubDate>
      <link>https://dev.to/vicky_ops/understanding-regression-testing-vs-retesting-1d6j</link>
      <guid>https://dev.to/vicky_ops/understanding-regression-testing-vs-retesting-1d6j</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;As a software tester, you're well aware that maintaining software quality is paramount. Two cornerstones of software testing, Regression Testing and Retesting, hold key roles in this endeavor. In this post, we'll explore these concepts, drawing distinctions through practical examples.&lt;/p&gt;

&lt;p&gt;Regression Testing&lt;/p&gt;

&lt;p&gt;Regression testing entails a comprehensive examination to confirm that recent code changes don't disrupt existing software functionalities. It's akin to ensuring that the latest touch-ups to a timeless painting don't alter its essence.&lt;/p&gt;

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

&lt;p&gt;Imagine you're part of a team working on a sprawling e-commerce platform. The development crew has just made substantial changes to the payment processing module, primarily aimed at boosting security. Now, their concern is whether these changes have inadvertently triggered any glitches or disrupted existing payment methods.&lt;/p&gt;

&lt;p&gt;Here's how regression testing unfolds in this context:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Baseline Testing&lt;/strong&gt;: Initially, the payment methods underwent rigorous testing to establish a baseline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Amendments&lt;/strong&gt;: With the security enhancements integrated, you receive the updated code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Regression Test Suite&lt;/strong&gt;: You've got a set of predefined test cases covering various payment scenarios.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test Execution&lt;/strong&gt;: These test cases are applied to the modified payment module. If any test fails or exhibits unexpected behavior, it signals a regression issue - a novel problem arising from the recent changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bugs Unveiled&lt;/strong&gt;: If discrepancies emerge, you document them, and the development squad rectifies these before the software release.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In essence, regression testing acts as an ongoing safety net, ensuring that recent modifications haven't compromised established functionalities.&lt;/p&gt;

&lt;p&gt;Retesting&lt;/p&gt;

&lt;p&gt;Retesting, conversely, is a more targeted approach. It involves examining a specific functionality or feature that has undergone adjustments or bug fixes, with the aim of confirming that the reported issue has been successfully addressed. Think of it as double-checking that a stain you tried to remove from a shirt has indeed disappeared.&lt;/p&gt;

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

&lt;p&gt;Suppose you stumbled upon a critical bug in the 'Add to Cart' feature of the e-commerce platform. Whenever a user added an item to the cart, it mysteriously duplicated. The development team diligently worked to fix this issue, and it's now your task to retest it.&lt;/p&gt;

&lt;p&gt;Here's how retesting plays out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Initial Bug&lt;/strong&gt;: You initially reported the issue, including precise steps to replicate it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Development Fix&lt;/strong&gt;: Developers investigated and resolved the bug.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Retesting Phase&lt;/strong&gt;: Your role now is to rigorously follow the exact steps you initially provided to reproduce the bug. If the bug no longer rears its head, you can confidently assert that the problem has been successfully rectified.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Closing the Chapter&lt;/strong&gt;: If the bug vanishes during your retesting, you mark the issue as resolved and close the bug report.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The crux here is that retesting zeroes in on a specific issue, confirming its resolution, while regression testing maintains a broader focus to detect inadvertent side effects.&lt;/p&gt;

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

&lt;p&gt;In sum, regression testing and retesting are pivotal components of software testing, each possessing a distinct purpose. Regression testing acts as a safeguard against unintended consequences of code modifications across the entire application, while retesting verifies the successful resolution of specific issues. As a software tester, mastering these techniques is indispensable in your role to guarantee a robust and glitch-free software product.&lt;/p&gt;

</description>
      <category>softwaretesting</category>
      <category>qualityassurance</category>
      <category>regressiontesting</category>
      <category>retesting</category>
    </item>
    <item>
      <title>Demystifying Test Scenarios and Test Cases in Testing</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Sun, 20 Aug 2023 14:53:46 +0000</pubDate>
      <link>https://dev.to/vicky_ops/demystifying-test-scenarios-and-test-cases-in-testing-2ke2</link>
      <guid>https://dev.to/vicky_ops/demystifying-test-scenarios-and-test-cases-in-testing-2ke2</guid>
      <description>&lt;p&gt;As a Software Development Engineer in Test (SDET), I'm often asked about the difference between test scenarios and test cases, particularly when it comes to testing. Let's dive into this essential aspect of software testing and clarify why understanding this distinction is vital for ensuring the quality of platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Scenarios: A Bird's Eye View&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Test scenarios provide a high-level, big-picture perspective of what we aim to test. They describe the overall context, objective, and scope of the test. In the realm of e-commerce, a test scenario outlines the fundamental functionalities or user interactions we need to assess. It's like setting the stage for our testing efforts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example of a Test Scenario (E-commerce Application):&lt;/strong&gt;&lt;br&gt;
Imagine we're testing an e-commerce platform. Our test scenario could be: "User completes a purchase transaction."&lt;/p&gt;

&lt;p&gt;In this scenario, we're focusing on a significant user action—making a purchase. It doesn't delve into the specifics of how to do it; instead, it sets the testing stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Cases: Nitty-Gritty Details&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's move to the detailed level—test cases. Test cases are the actionable, step-by-step instructions for executing a particular test scenario. They define precisely how we'll navigate through the application, what inputs we'll provide, and what results we expect at each step. In our e-commerce example, test cases break down the scenario into manageable steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example of a Test Case (E-commerce Application):&lt;/strong&gt;&lt;br&gt;
For our "User completes a purchase transaction" scenario, we'd create individual test cases for each step:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test Case 1: Log In&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action: Log in to the user account.&lt;/li&gt;
&lt;li&gt;Expected Result: Successful login, user's dashboard displayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Case 2: Product Selection&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action: Search for a specific product, add it to the cart.&lt;/li&gt;
&lt;li&gt;Expected Result: Product added to the cart, cart total updated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Case 3: Checkout Process&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Action: Go to the cart, proceed to checkout.&lt;/li&gt;
&lt;li&gt;Expected Result: Checkout page displayed, shipping and payment options available.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And so on, until we've covered each step in the scenario.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Distinction Matters in&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understanding the difference between test scenarios and test cases is vital, especially when testing applications:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Effective Planning&lt;/strong&gt;: Test scenarios help us plan our testing efforts by identifying critical user journeys or functionalities, like purchasing a product.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comprehensive Testing&lt;/strong&gt;: Test cases ensure that we test each step rigorously. This granularity helps catch issues at every stage, ensuring a smooth user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reproducibility&lt;/strong&gt;: Well-defined test cases make our testing repeatable. Anyone following the same steps should achieve the same results, making it easier to identify and fix issues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prioritization&lt;/strong&gt;: With test scenarios, we can prioritize what's most crucial to test based on business objectives. Test cases allow us to thoroughly assess each priority item.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, test scenarios set the stage for testing by outlining high-level objectives, while test cases provide the detailed script for executing those objectives. Both are essential for thorough and organized testing of applications, ensuring the best possible user experience.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SubArray/SubString</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Tue, 31 May 2022 06:00:38 +0000</pubDate>
      <link>https://dev.to/vicky_ops/subarraysubstring-1h9i</link>
      <guid>https://dev.to/vicky_ops/subarraysubstring-1h9i</guid>
      <description>&lt;h1&gt;
  
  
  Sub Array/Sub Strings
&lt;/h1&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A Sub array or a subString is **contiguous part** of array/strings.
subarray's are part of like array's with in array's.
Let's look into some example

Find the substrings of "masai":
 The total number of non-empty substrings are 15 . You might ask how? lets find it mathmetical way
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;     &lt;span class="c1"&gt;//Given string&lt;/span&gt;
     &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;masai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// finding the length/total element&lt;/span&gt;
     &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
     &lt;span class="c1"&gt;//Once we have total count of element which is 5 here&lt;/span&gt;
     &lt;span class="c1"&gt;// the formula is easy n*n+1/2&lt;/span&gt;
    &lt;span class="c1"&gt;//  So that's it lets apply the formula here&lt;/span&gt;
    &lt;span class="c1"&gt;// so here n=5 according to the formula&lt;/span&gt;
    &lt;span class="c1"&gt;// 5*5+1/2 = 15&lt;/span&gt;
    &lt;span class="c1"&gt;// so total of non-empty sub-stings will be 15&lt;/span&gt;
&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; Formula is n*n+1/2
 n is the total count of element/length

 Now lets find the substrings of the string on pen and paper
&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;Here is the list of possible substrings of the string
'm' 
'm' 'a' 
'm' 'a' 's' 
'm' 'a' 's' 'a' 
'm' 'a' 's' 'a' 'i' 
'a' 
'a' 's' 
'a' 's' 'a' 
'a' 's' 'a' 'i' 
's' 
's' 'a' 
's' 'a' 'i' 
'a' 
'a' 'i' 
'i' 
&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;There we have it exactly 15 sub-strings.

Anyway Here is the javascript implementation to get substings.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;masai&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;str1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="nx"&gt;str1&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>dsa</category>
      <category>subarray</category>
      <category>substring</category>
    </item>
    <item>
      <title>Primitive type</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Sat, 02 Apr 2022 17:15:41 +0000</pubDate>
      <link>https://dev.to/vicky_ops/primitive-type-14jb</link>
      <guid>https://dev.to/vicky_ops/primitive-type-14jb</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;javaScript&lt;/em&gt;&lt;/strong&gt; Oh boi!! the defacto language for Web. And for today we will be focusing on it's types mainly its &lt;strong&gt;&lt;em&gt;Primitive type&lt;/em&gt;&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;But before jumping on Primitive type, lets discuss bit about the language itself. Javascript is a dynamic language it basically means variables in javascript are not directly associated with any particular type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Depending on its type  js  broadly can be divided upon ::
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Primitive types.&lt;/li&gt;
&lt;li&gt;Objects.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Primitive Type
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Primitive Type&lt;/strong&gt; is immutable by nature, So what does it means,&lt;br&gt;
a piece of code can summarize it nicely.&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;let&lt;/span&gt; &lt;span class="nx"&gt;number1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;// we are declaring a variable and assigning with a Number 1&lt;/span&gt;
&lt;span class="nx"&gt;number1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;//Here we are reassigning number1 to 2, in any way we are not updating it.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, As in the comments in the above code we are not mutating the variable simply we are reassigning it. As for every other Primitive type they are immutable in javascript.&lt;/p&gt;

&lt;h3&gt;
  
  
  In JS we have 7 primitive types ::
&lt;/h3&gt;

&lt;p&gt;1.Number.&lt;br&gt;
2.Big Int.&lt;br&gt;
3.String.&lt;br&gt;
4.Undefined.&lt;br&gt;
5.null(techically object)&lt;br&gt;
6.Boolean&lt;br&gt;
7.Symbol(recent addition the langauge ES2015)&lt;/p&gt;

&lt;p&gt;But, we are going too fast right, some people might ask how do get to know its type . Simply we can use &lt;code&gt;typeof&lt;/code&gt; operator to check for it, it will be useful so we will try to remember it.&lt;/p&gt;
&lt;h4&gt;
  
  
  Numeric Type ::
&lt;/h4&gt;

&lt;p&gt;Javascript has two Numeric types&lt;br&gt;
   1.Number type&lt;br&gt;
   2.BigInt&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Number type&lt;/strong&gt; in javascript are not integers they are floating- &lt;br&gt;
 point numbers, Technically &lt;em&gt;double-precision 64-bit binary &lt;br&gt;
 format&lt;/em&gt;. So below is Code Summary&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;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;//variable assignment to a Number type&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//will return type of number&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAX_SAFE_INTEGER&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//will return `9007199254740991` as the max safe integer.&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MIN_SAFE_INTEGER&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//will return `-9007199254740991` as the min safe integer.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;BIG INT&lt;/strong&gt; comes handy if you want to work on really big numbers even beyond &lt;code&gt;Number.MAX_SAFE_INTEGER&lt;/code&gt; or its inverse &lt;code&gt;Number.MIN_SAFE_INTEGER&lt;/code&gt; . &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#primitive_values"&gt;Mozilla docs&lt;/a&gt; wraps it nicely have a look if you want to dive deeply. we will skip to next type😎.&lt;/p&gt;

&lt;h4&gt;
  
  
  String Type ::
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;String&lt;/strong&gt; is fundamental type regardless of whatever type of language it is. Rule of Immutability play's here as well it means when we are adding a character or concatenating two strings we are reassigning the previous string to a new string, not necessarily modifying the old string.&lt;br&gt;
Its fairly a basic data type for any language. So, look at the code below ::&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Richard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="c1"&gt;//A simple variable declarations with a string assignment&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Undefined
&lt;/h4&gt;

&lt;p&gt;Yes &lt;strong&gt;undefined&lt;/strong&gt; is a type  and it is used  implicitely in javascript even if your not using it explicitly. what does it means below code block it clear it out.&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;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="c1"&gt;//say you forgot to assign value to the value, javascript implicitely assigns undefined as its value.&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//so it will return undefined as its value.&lt;/span&gt;
&lt;span class="c1"&gt;//avoid undefined in case of intentional empty variable assignment use null instead.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  null type
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;null&lt;/strong&gt; is a primitive type in javascript, it is represented by literal &lt;code&gt;null&lt;/code&gt;. and mostly null represents intentional absence of any value by developer.&lt;br&gt;
But &lt;code&gt;typeof null&lt;/code&gt; returns objects type there are many article are out there for this weird behaviour, its a bug to-be precise according to lot of articles.&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;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;//intentional absence of any value assignment.&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//will return object , weird isn't it.&lt;/span&gt;
&lt;span class="c1"&gt;//both undefined &amp;amp; null seems to be same but they are not&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;// will return true they are both absent of any value.&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;// will return false here cause we are checking both value and type. Their type is different&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;above code also makes it clear that &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; are not same they have some similarity but of different use. be smart before using each of one them.&lt;/p&gt;

&lt;h4&gt;
  
  
  Boolean type
&lt;/h4&gt;

&lt;p&gt;Boolean types are represented by two literal &lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt;, yes as simple as that. And Booleans are everwhere from any conditional like if-else,switch to operator like &lt;code&gt;==&lt;/code&gt; &amp;amp; &lt;code&gt;===&lt;/code&gt;. So proper  understading is mandatory. Code below will clear it out.&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;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;// will assign true boolean as value to bool variable.&lt;/span&gt;
&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;boo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//will return boolean&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;boole= &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="c1"&gt;// here if block is going to run only if the value bool evalutes to true try changing to false it will not run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Symbol
&lt;/h4&gt;

&lt;p&gt;Symbol is a primitive type in javascript like other types mentioned above. Its Added in ECMAScript 2015 fairly recent addition. unlike others Number,String,null,undefined,boolean it &lt;strong&gt;doesn't have any literal&lt;/strong&gt; it represent it&lt;/p&gt;

&lt;p&gt;To create a new Symbol we use global method method like below ::&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;let&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&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;As with Symbol with each invokation of &lt;code&gt;Symbol()&lt;/code&gt;it returns unique private value so &lt;code&gt;Symbol() == Symbol()&lt;/code&gt; will be false.&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="nb"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nb"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//returns false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, here we are at the end of this post. I made an effort to simplyfy things in javascript which seems daunting from a new developers perspective. javascript have lot of concepts which are needed to-be well understood to leverage the language itself, I am following this &lt;a href="https://github.com/leonardomso/33-js-concepts"&gt;&lt;strong&gt;amazing github repository&lt;/strong&gt;&lt;/a&gt; for holistic javascript undersanding, Check it guys/gals.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>33jsconcepts</category>
      <category>webdev</category>
      <category>jsnotes</category>
    </item>
    <item>
      <title>Queue using Linked List ES6</title>
      <dc:creator>vicky-ops</dc:creator>
      <pubDate>Tue, 15 Mar 2022 16:27:00 +0000</pubDate>
      <link>https://dev.to/vicky_ops/queue-using-linked-list-51da</link>
      <guid>https://dev.to/vicky_ops/queue-using-linked-list-51da</guid>
      <description>&lt;h3&gt;
  
  
  Queue
&lt;/h3&gt;

&lt;p&gt;Queue is an Abstact data structure, similar to Stacks, but differs, a queue is open at its both ends, One end is used to insert data (enque) and the other is used to removed data (dequeue). Queue follows First-in-First-Out methodology.&lt;/p&gt;

&lt;p&gt;A real-world example is a queue of people waiting for getting vaccinated for covid. First comers will get vaccinated first.&lt;/p&gt;

&lt;h4&gt;
  
  
  Operations
&lt;/h4&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fundamental Operation ::
1. enqueue() -- store an item to the queue;
2. dequeue() -- remove an item from the head/first element
Auxilary operation::
1. peek() -- Get the first element with-out dequeue()
2. isfull() -- Checks if the queue is full.
3. isempty() -- Checks if the queue is empty.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Javascript implementation of Queue (Linked-List)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Queue implementation in linked list&lt;/span&gt;

&lt;span class="c1"&gt;// Node class&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Node&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Queue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;peek&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
        &lt;span class="c1"&gt;// check if the list if empty&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List is empty&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;enqueue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;// check if the list if empty&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newNode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newNode&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;dequeue&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="c1"&gt;//if first is equal null&lt;/span&gt;
         &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Empty List&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
         &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//remove the last reference&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;holding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;holding&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// new instance of the Queue&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Queue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="c1"&gt;// peek &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;peek&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="c1"&gt;// enque first node&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enqueue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gopi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enqueue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Venkata&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enqueue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Poorna&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;// peek again&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;peek&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="c1"&gt;// Dequeue&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dequeue&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dequeue&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dequeue&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dequeue&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>queue</category>
      <category>datastructure</category>
      <category>jsnotes</category>
    </item>
  </channel>
</rss>
