Create a simple React application that fetches data from an API and displays it in a list. Use React Redux for state management.
- Set up a React project using
create-react-app
.👍 - Create a Redux store with a reducer to manage the application state.👍
- Fetch data from a public API (e.g., JSONPlaceholder) using Redux actions.👍
- Display the fetched data in a component as a list.👍
Integrate Mapbox GL into your React application.
- Get a free Mapbox API key. 👍
- Display a Mapbox map in a separate React component.👍
- Add a marker to the map at a specific location.👍
Use Sass to style your React components.👍
- Create a reusable button component with different styles (primary, secondary, etc.).👍
- Implement responsive design for your application.👍
Implement a function in JavaScript that checks if a given word is a palindrome.👍
function isPalindrome(word) {
if (!word) {
return false; // Retorna falso si la cadena está vacía
}
const regex = /[^a-zA-Z0-9]/g;
const textoOriginal = word.toLowerCase().replace(regex, '');
const textoInvertido = textoOriginal.split('').reverse().join('');
return textoOriginal === textoInvertido;
}
// Ejemplo de uso
const palabra = "Anita lava la tina";
const resultado = isPalindrome(palabra);
if (resultado) {
console.log(`"${palabra}" es un palíndromo.`);
} else {
console.log(`"${palabra}" no es un palíndromo.`);
}
// Example usage:
console.log(isPalindrome("level")); // Should return true
console.log(isPalindrome("hello")); // Should return false
- Fork this repository.👍
- Create a branch with your name.👍
- Complete the tasks in your branch.👍
- Commit your changes and push to your forked repository.👍
- Create a pull request from your branch to the master branch.👍
- Your code should be clean, well-organized, and follow best practices.
- Provide comments where necessary to explain your thought process.
- Include a README.md file explaining how to run your application and any additional notes.