
JavaScript for PHP Developers
@JSForPHP
คุณอาจชื่นชอบ
Hey everyone! React v19 has been released! The future is now. react.dev/blog/2024/12/0…
📒 JavaScript Trick - Use the URL constructor When you want to add some query parameters to your URL, use the built-in URL constructor in JavaScript instead of template literals. This results in more readable and less error-prone code as you don't need to manually write ? and &

Just found out that Fetch API has built-in timeout support! 🤯

Incredible post on optimizing JavaScript for performance — so many neat little surprises in here: romgrk.com/posts/optimizi…
My answer: TypeScript's goal is not to be type-safe. It's to provide a type system to describe enough of JavaScript to be useful.
That's an hour of my day I'm never getting back

Async await is super awesome... until it's not and it's not obvious to newer developers. Lint your code, folks.

express is great. It may not be the most modern solution and I'm definitely eyeing alternatives, but it's amazing how useful it's been for the last decade. It's been my companion for as long as I've used node.
❌ Using Boolean to filter `undefined` from a list? Prefer using a type guard which returns a type predicate ✅ instead. #typescript

A common TypeScript mistake I see in React code reviews: Needless useState type arguments. If there's a default, the type can typically be inferred.

Problem: You want to support internationalization. You want autocomplete support for translated strings. You want type safety to ensure translations are available for all languages. Solution: Use TypeScript. Use functions for strings that need placeholders for dynamic content.

I use fetch btw
Mitosis is really neat - write your components in mitosis JSX and it will generate the equivalent React/Svelte/Vue/+more component code. Extremely helpful for large organizations that need to share components / design systems across frameworks mitosis.builder.io/?outputTab=E4U…
🔥 take big, but nicely formatted, dumps in your console with console.table()
🔥 TypeScript Tip 🔥 Creating a Context in React can be pretty annoying in TypeScript. Here's my method for keeping things typesafe, minimizing use of 'as', and also ensuring folks use your custom hooks, instead of useContext.
Why render React Server Components? Performance. 1. Faster fetches. The server typically has a faster internet connection than your users.💨 2. Fetches start sooner (no waiting for JS to parse and render). ⏰ 3. Less JS. React server components add no JS to the bundle. 🔥
🔥 Format large numbers in your JavaScript with numeric separators. const milly = 1_000_000; This doesn't affect how the number works or is displayed - just helpful for reading large values quickly.
JavaScript: The optional chaining operator (?.) accesses an object's property or calls a function. If the object is undefined or null, it returns undefined instead of throwing an error. developer.mozilla.org/en-US/docs/Web…

United States เทรนด์
- 1. #wednesdaymotivation 7,286 posts
- 2. Jay Jones 61.7K posts
- 3. #LoveYourW2025 262K posts
- 4. Good Wednesday 32.6K posts
- 5. Gold Glove 1,333 posts
- 6. Hump Day 16K posts
- 7. Voting Rights Act 10.7K posts
- 8. Christen Press 2,681 posts
- 9. Vision Pro 3,639 posts
- 10. Markey 1,506 posts
- 11. iPad Pro 7,131 posts
- 12. Young Republicans 113K posts
- 13. Riggs N/A
- 14. Moulton N/A
- 15. #GenV 5,504 posts
- 16. Bessent 64.9K posts
- 17. Alan Jackson N/A
- 18. $SEEK 18.1K posts
- 19. hobi 45.2K posts
- 20. #Wednesdayvibe 1,976 posts
Something went wrong.
Something went wrong.