The Prompt Library
CodingJavaScript

Convert JavaScript to ES6+

Modernize older JavaScript code using ES6+ syntax and best practices.

Select Model:

Prompt:

I need help converting older JavaScript code to modern ES6+ syntax. Please update the code to use contemporary JavaScript features and best practices while maintaining its functionality. Here's the code to modernize: ```javascript [PASTE CODE HERE] ``` Please provide: 1. MODERNIZED CODE * Complete updated version using ES6+ features * Consistent, clean coding style * Proper use of modern JavaScript best practices * Preserved functionality and behavior 2. CHANGES EXPLAINED * Overview of the main updates made * Explanation of each significant syntax change * How new ES6+ features improve the code * Any performance or readability benefits 3. SPECIFIC ES6+ FEATURES APPLIED * Arrow functions * Template literals * Destructuring * Spread/rest operators * let/const declarations * Classes (if applicable) * Promises/async-await (if applicable) * Modules (if applicable) * Other relevant ES6+ features 4. ADDITIONAL IMPROVEMENTS * Modern best practices implementation * Code structure enhancements * Potential performance optimizations * Better error handling if applicable * Any security improvements 5. COMPATIBILITY CONSIDERATIONS * Browser compatibility notes * Transpilation recommendations if needed * Polyfill suggestions if applicable * Progressive enhancement strategies * How to ensure backward compatibility Please ensure the modernized code maintains exactly the same functionality as the original while leveraging modern JavaScript features for improved readability, maintainability, and performance.

Related Prompts

Other prompts you might find useful

CodingJavaScript

JavaScript Function Generator

Create a custom JavaScript function with parameters and error handling.

6 models availableView details
CodingJavaScript

Debug a JavaScript Bug

Identify and fix issues in your JavaScript logic or syntax.

6 models availableView details
CodingJavaScript

Convert JavaScript to ES6+

Modernize older JavaScript code using ES6+ syntax and best practices.

6 models availableView details
CodingJavaScript

React Component Prompt

Generate a reusable React functional component with props and state.

6 models availableView details