Dealing with JavaScript browser compatibility can be challenging, especially when features behave differently across browsers. What strategies or tools do you use to write cross-browser compatible JavaScript code? Are there specific practices, polyfills, or testing approaches that help ensure smoother compatibility across environments like Chrome, Firefox, Safari, and Edge?