Quantcast
Channel: Help me clean up my functional JS
Browsing all 13 articles
Browse latest View live

Help me clean up my functional JS

@AdventureBear wrote: This is working for me, but I feel like there is a more concise way to use the filter on an array of objects. This code goes through an object containing multiple-choice...

View Article



Help me clean up my functional JS

@DanCouper wrote: That’s not how filter works: it needs to return true or false. You don’t return a value, what you do is return a new array containing only the elements that return true for the...

View Article

Help me clean up my functional JS

@AdventureBear wrote: Thanks, that helps a lot. You know, i’ve been doing this (as a hobby) for 5 years now, I hope I eventually can sort these out. A lot of my applications involve complex objects...

View Article

Help me clean up my functional JS

@AdventureBear wrote: This is working for me, however I can’t seem to grab just the ID with this syntax, I get an error ‘id is not defined’ return quizQuestion.answers.find((answer) =>...

View Article

Help me clean up my functional JS

@RandellDawson wrote: I believe it should be .id instead of [id], since id is a property of each object. Read full topic

View Article


Help me clean up my functional JS

@AdventureBear wrote: That’s it! Thanks I was going crazy. Read full topic

View Article

Help me clean up my functional JS

This is working for me, but I feel like there is a more concise way to use the filter on an array of objects. This code goes through an object containing multiple-choice questions. Each question has...

View Article

Help me clean up my functional JS

That’s not how filter works: it needs to return true or false. You don’t return a value, what you do is return a new array containing only the elements that return true for the condition you give it....

View Article


Help me clean up my functional JS

Thanks, that helps a lot. You know, i’ve been doing this (as a hobby) for 5 years now, I hope I eventually can sort these out. A lot of my applications involve complex objects like this one. I tried...

View Article


Help me clean up my functional JS

This is working for me, however I can’t seem to grab just the ID with this syntax, I get an error ‘id is not defined’ return quizQuestion.answers.find((answer) => answer.correct === true)[id]; I...

View Article

Help me clean up my functional JS

I believe it should be .id instead of [id], since id is a property of each object. Read full topic

View Article

Help me clean up my functional JS

That’s it! Thanks I was going crazy. Read full topic

View Article

Help me clean up my functional JS

Read full topic

View Article

Browsing all 13 articles
Browse latest View live




Latest Images