<?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: Jodie Farghly</title>
    <description>The latest articles on DEV Community by Jodie Farghly (@jodie_farghly_26214dcc8c0).</description>
    <link>https://dev.to/jodie_farghly_26214dcc8c0</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%2F3559801%2Fa2cf7530-83be-41aa-9385-8838d0b1de0c.png</url>
      <title>DEV Community: Jodie Farghly</title>
      <link>https://dev.to/jodie_farghly_26214dcc8c0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jodie_farghly_26214dcc8c0"/>
    <language>en</language>
    <item>
      <title>online</title>
      <dc:creator>Jodie Farghly</dc:creator>
      <pubDate>Sat, 11 Oct 2025 22:01:21 +0000</pubDate>
      <link>https://dev.to/jodie_farghly_26214dcc8c0/online-4gh3</link>
      <guid>https://dev.to/jodie_farghly_26214dcc8c0/online-4gh3</guid>
      <description>&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;&lt;code&gt;`&lt;br&gt;
let cart = JSON.parse(localStorage.getItem('cart')) || [];&lt;br&gt;
function addToCart(name, price) {&lt;br&gt;
    cart.push({ name, price });&lt;br&gt;
    localStorage.setItem('cart', JSON.stringify(cart));&lt;br&gt;
    updateCart();&lt;br&gt;
}&lt;br&gt;
function updateCart() {&lt;br&gt;
    document.getElementById('cart-count').textContent = cart.length;&lt;br&gt;
    const cartItems = document.getElementById('cart-items');&lt;br&gt;
    const total = cart.reduce((sum, item) =&amp;gt; sum + item.price, 0);&lt;br&gt;
    cartItems.innerHTML = cart.map(item =&amp;gt; `&amp;lt;li&amp;gt;${item.name} - $${item.price.toFixed(2)}&amp;lt;/li&amp;gt;`).join('');&lt;br&gt;
    document.getElementById('cart-total').textContent = total.toFixed(2);&lt;br&gt;
}&lt;br&gt;
function checkout() {&lt;br&gt;
    if (cart.length === 0) {&lt;br&gt;
        alert('Your cart is empty!');&lt;br&gt;
    } else {&lt;br&gt;
        alert(`Proceeding to checkout for $${document.getElementById('cart-total').textContent}. (Demo only!)`);&lt;br&gt;
        cart = [];&lt;br&gt;
        localStorage.removeItem('cart');&lt;br&gt;
        updateCart();&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
// Initialize cart on load&lt;br&gt;
updateCart();&lt;br&gt;
`&lt;/code&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
