Learn Form Validation by Building a Calorie Counter - Step 26

Tell us what’s happening:

I followed the hint and doesn’t work
I don’ t understood th regex

function cleanInputString(str) {
   const regex = /[+\-\s]/g;

}

ATTENZIONE

Il codice seed della sfida e/o la tua soluzione hanno superato la lunghezza massiama che possiamo importare dalla sfida.

Dovrai fare un passo in più in modo che il codice che hai scritto abbia un formato semplice da leggere.

Copia/incolla tutto il codice mostrato nell’editor della sfida da dove ti sei appena collegato.

Sostituisci queste due frasi con il codice copiato.
Si prega di lasciare la linea ``` sopra e la linea ``` sotto,
perché consentono al codice di disporsi correttamente nel post.

Your browser information:

Lo user agent è: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 26

The hint says:

Your regex variable should be set to the regular expression [+-\s].

Your regex variable is set to [+\-\s].

Do you see the difference?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.