Sold out in 5 hours 🤯
If you missed it, we're giving away 3 Raycast keyboards.
To enter:
1️⃣ Follow @raycast and @nuphystudio
2️⃣ Repost this tweet
3️⃣ Reply with your favorite shortcut
We'll pick 3 winners on Monday. Good luck!
💡JavaScript Tips:
Optional Chaining for Safe Property Access
const user = {
address: {
street: "123 Main St"
}
}
// Old way
const street = user && user.address && user.address.street
// Modern way
const street = user?.address?.street
Common use cases for stacks include:
- Function call management (call stack)
- Undo/Redo operations
- Expression evaluation
- Browser history
- Syntax parsing
🚀 Understanding Stack Data Structure
A Stack is a linear data structure that follows LIFO (Last In First Out).
Think of it like a stack of plates - you can only:
1. Add (push) a plate to the top
2. Remove (pop) a plate from the top
3. Look at (peek) the top plate without removing it
The implementation I provided includes all basic stack operations:
- push(): Add element to top
- pop(): Remove and return top element
- peek(): View top element without removing
- isEmpty(): Check if stack is empty
- getSize(): Get number of elements
- clear(): Remove all elements
Explanation of cn utility function from #shadcn/ui
The cn function combines two popular utilities:
1️⃣clsx - For conditionally joining CSS class names
2️⃣tailwind-merge - For merging Tailwind CSS classes intelligently, removing conflicts