# 081: Intent Comments # Tell the AI what you want, not how to do it ### Intent: Parse this CSV data and extract email addresses data = """ name,email,age Alex,alex@example.com,28 Jordan,jordan@example.com,25 Casey,casey@example.com,30 """ # AI expands the intent into working code: # emails = data.split("\n").slice(1).map(line => { # parts = line.split(",") # return parts[1] # }).filter(email => email != "") ### Intent: Calculate the total price including tax cart_items = [ { name: "Book", price: 19.99 }, { name: "Pen", price: 2.50 }, { name: "Notebook", price: 5.99 } ] tax_rate = 0.08 # AI generates: # subtotal = cart_items.reduce((sum, item) => sum + item.price, 0) # total = subtotal * (1 + tax_rate) ### Intent: Format this date as "January 15, 2025" timestamp = 1705334400000 # Unix timestamp # AI knows how to format dates in natural language # The ### syntax tells the AI: # "This is an intent, not just a comment - turn it into code"