Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
How can I make my react search engine to accept both upper and lower case letters?

Hi there my react application is a todolist and has a search engine to filter notes, currently it works if you search for the note but in lower case, how could I make it accept both upper and lower case?

For example, for the javaScript note, it would find it whether I put JAVAscrIPT or jAVAscriPT.

This is my code

const App = () => {
  const [notes, setNotes] = useState([]);
  const [searchText, setSearchText] = useState('');
  const [showNote, setShowNote] = useState(true); //eslint-disable-lint

  const addNote = (inputText, text) => { 
    const date = new Date();
    const newNote = {
      id: nanoid(),
      title: inputText,
      text: text,
      date: date.toLocaleString()
      
    }
    const newNotes = [newNote, ...notes];
    setNotes(newNotes)
  }
  const filterNotes = notes.filter((noteText) => noteText.title.toLowerCase().includes(searchText)); 

//rest of code

A greeting and thanks in advance!

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You forgot to use toLowerCase on searchText

const filterNotes = notes.filter((noteText) => noteText.title.toLowerCase().includes(searchText.toLowerCase())); 
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda