Post any code you think might be relevant (one fenced block per file)
let today = new Date(),
date = `${today.getFullYear()}-${(today.getMonth()+1)}-${today.getDate()}`
let thisDayNutrition = allNutrition.filter(object, index => object.date == today)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
no error message but the filter isn't working
What is your best guess as to the source of the problem?
the format of the dates are different so the filter will never === true.
What things have you already tried to solve the problem?
different filter arguments and different date constructors
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
Trying to solve a date comparison for my filter
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
no error message but the filter isn't working
What is your best guess as to the source of the problem?
the format of the dates are different so the filter will never === true.
What things have you already tried to solve the problem?
different filter arguments and different date constructors