Skip to content

Music player playlist logic

I’m creating a small music player web app, everything works fine, I have a problem: I want to create a playlist for it too and I’m kind of beginner in JS and I don’t know how to create the logic for that (every time user click on a specific song title in playlist, play that exact song which …

Ignore $in if empty array is provided

I have the following model: Note: interface matches the model exactly but i pasted this as its much shorter. I am using the following data to filter through this collection: What i want to achieve is to find every document and check if the corresponding array has at least one of the values from the array i se…

Put a dynamic src for an img (React/JS)

I created a function that returns a img tag with a dynamic src, Everything works but I want to make it shorter : Dirty version Cleaner attempt version But for my cleaner attempt, the image is not shown 🙁 Answer Kind of a solution; you can put the images to an object and then