I'm doing an exercise in JavaScript and I don't understand the error. I describe what you request and copy how I do it
Our mission, now, is to create a called function reemplazoFastFast
that will receive the following three parameters:
A text.
The word we are looking to replace.
The word we are going to use to replace.
The function should return the text with the word replaced.
This is what I tried!
function reemplazoFastFast (texto,buscar,usar){
let reemplazoFastFast= ('El viernes comemos carne','carne','verduras')
console.log(reemplazoFastFast.replace ('mala','buena'))
}
I think you are not understanding well how a function works, you have to declare the function and then call it, within it do what you want with the parameters.