--

Hey there Edkristian!

Without seeing the code you currently have, I'm going to guess that the reason your comparison function isn't working is because you need to be returning a `true` or `false` value within your filter function.

Assuming you have a helper function called `coordinatesInRange(lat, lng)` that returns `true` or `false` if the coordinates are within 25 miles, you would want to structure your filter function to look like this:

data.filter( (item) => {

// Perform any other conditional checks

...

return coordinatesInRange(item.lat, item.lng);

});

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tyler Burdsall
Tyler Burdsall

Written by Tyler Burdsall

A software developer in Portland with too many opinions

No responses yet

Write a response