// Setup
function testStrict(val) {
if (val === val) { // Change this line
return "Equal";
}
return "Not Equal";
}
// Change this value to test
testStrict(7);
i need help with this
// Setup
function testStrict(val) {
if (val === val) { // Change this line
return "Equal";
}
return "Not Equal";
}
// Change this value to test
testStrict(7);
i need help with this
I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>
) will also add backticks around text.
What does the failing test say? Right now your function will always return 'Equal'
because you are testing whether val
is equal to itself. Is this the challenge requirement?
…
thanks, i got it
// Setup
function testStrict(val) {
if (val === ‘10’) { // Change this line
return “Equal”;
}
return “Not Equal”;
}
// Change this value to test
testStrict(10);
// Setup
function testStrict(val) {
if (val === 7) { // Change this line
return “Equal”;
}
return “Not Equal”;
}
// Change this value to test
testStrict(7);
// Setup
function testStrict(val) {
if (val === 7) { // Change this line
return “Equal”;
}
return “Not Equal”;
}
// Change this value to test
testStrict(“7”);
My exercise, I used this solution.
// Setup
function testStrict(val) {
if (val === ‘10’) {
// Change this line
return “Equal”;
}
return “Not Equal”;
}
// Change this value to test
testStrict(10);
function testStrict(val) {
if (val === 7) {
// Change this line
return “Equal”;
}
return “Not Equal”;
}
// Change this value to test
testStrict(7);