Skip to content
Prev Previous commit
Next Next commit
clean up function
  • Loading branch information
leo-step committed Jul 23, 2022
commit 4073748fceb345eee7379e3a993512f772b3f765
6 changes: 2 additions & 4 deletions src/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ const Table = () => {

const filteredByCheckbox = () => {
const checkbox = localStorage.getItem('checkbox') || '';
return questions.filter(question => {
if (!checkbox) return true;
return question.checkbox === checkbox;
});
if (!checkbox) return questions;
return questions.filter(q => q.checkbox === checkbox);
};

for (let i = 0; i < questions.length; i += 1) {
Expand Down