Ask coding questions

← Back to all posts
in the pre-course
Larchent14 (0)

function exerciseThree(value){
// In this exercise, you will be given a variable, it will be called: value
// On the next line create a variable called 'equalTo' and using a comparison operator, check to see if value is equal to 37.
// Assign the results of that to 'equalTo'
let equalTo = value === '37';

the last line above is my response to a quiz. but it failed. can somebody please tell me whats wrong with it?

Answered by mat1 (2518) [earned 5 cycles]
View Answer
Commentshotnewtop
mat1 (2518)

You put quotes around 37, which makes it check whether or not it's the string 37, and not the number 37. Remove the quotes and your answer should be correct.
Please mark my comment as the answer if it's helpful. Thanks!