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

Edwin Alvarez
Edwin Alvarez
4,903 Points

This code doesn't work in safari

I tried running the code in safari but it doesn't work the same, is this an CSS issue rather than JavaScript? Please help.

When I run it on safari I can't quit the loop by clicking cancel and I can't see the students that the loop returns unless I break out of the loop.

1 Answer

Sam Meisler
PLUS
Sam Meisler
Courses Plus Student 7,793 Points

In Safari the cancel button for a prompt returns an empty string, so not your fault, it's the browser. You can instead of null, put : search === '' instead of search === null although now the loop will break if nothing is entered at all or, don't use Safari for this exercise.