function trueOrFalse() {
// Cambia solo el código debajo de esta línea
if (wasThatTrue){
return “Yes that was true”;
}else{
return “No, that was false”;
};
function trueOrFalse(wasThatTrue) {
// Cambia solo el código debajo de esta línea
function trueOrFalse(wasThatTrue){
return “Yes, that was true”;
}
return “No, that was false”;
// Only change code above this line.
}
function trueOrFalse(wasThatTrue) {
// Cambia solo el código debajo de esta línea
if wasThatTrue(true){
return "Yes, that was true";
}
return "No, that was false";
}
I’m not using any different quotes, you are seeing them different for whatever reason.
Thanks for the help but i dont understand why theres one function that should be enough “trueOrFalse” and then why do i need another function “wasThatTrue” or argument i dont understand how computer understand that as a parameter if its not a reserved word.
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Ok backticks for the code. Is it the same if i use any other signs comas or apostrophs? Or is it necesary only back ticks?
Preformated text tool, where is that i dont see anything on my browser nor in settings.
I know a function is not a parameter but if im right i’ve seen do a function inside of a function would could be confusing as paramenters seem to be inside of a function for the most part. And why isnt there a “true” as a parameter but a “wasThatTrue” parameter i dont understand.
function test(myCondition) {
if (myCondition) {
return "It was true";
}
return "It was false";
}
test(true);
test(false);
and this is what i did
function trueOrFalse(wasThatTrue) {
// Cambia solo el código debajo de esta línea
if wasThatTrue(true){
return "Yes, that was true";
}
return "No, that was false";
}
First comes the function with the paramenters then curly braces to enter the inside of the function. Parameters shouldnt be true or false? why is there this wasThatTrue expresion if its not declared or mentioned before idk where it comes from or what to do with it.