fix: remove HTML script tags from JS file and fix bill total accumulation - #952
Open
saurabhhhcodes wants to merge 1 commit into
Open
fix: remove HTML script tags from JS file and fix bill total accumulation#952saurabhhhcodes wants to merge 1 commit into
saurabhhhcodes wants to merge 1 commit into
Conversation
…tion - Remove raw HTML script tags embedded in cart.js causing syntax error - Fix calculateBill to use local total instead of global accumulator - Fix undeclared variables leaking to global scope
There was a problem hiding this comment.
Great job, @saurabhhhcodes! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.We will promptly review your changes and offer feedback. Keep up the excellent work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs Fixed
<script>tags were embedded inside a.jsfile (lines 77-100), causing a JavaScript parse error.let total = 0was declared at module scope and accumulated across everycalculateBill()call instead of being reset each time. Also,itemPricesandplackedconst/letdeclarations, leaking to the global scope.Changes
totalvariable insidecalculateBill()and added properconst/letdeclarations