Build an Apply Discount Function - Build an Apply Discount Function

It makes me crazy to understand the instructions

I initially struggled to code this project due to the instructions being a bit confusing. So, I decided to ask Gemini to help me, and it really helped me understand how functions and scopes work. Here is my code that passed the tests. You guys should try working with Gemini; it is super useful for studying.

Your code so far

code removed by moderator

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

Challenge Information:

Build an Apply Discount Function - Build an Apply Discount Function

GitHub Link: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-discount-calculator/695774002591bbc5f8cf3e53.md

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

okay its my first post. Thanks for telling me useful information