Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects The Student Record Search Challenge Solution

Vic Mercier
Vic Mercier
3,276 Points

If

Is it the same thing aren't: if(student.name === search){

} if(search ===student.name){

} MY mind is like if I say 5=8 and 8=5 so it should be the same thing with if?

1 Answer

They are the same thing. However, for things like this, just try it and use a console.log inside the if statement to see if it runs. If it does work, you learn something new.

Personally, I learned most of my Javascript just experimenting. On treehouse some valid code may not pass challenges since they want you to learn their way.