r/HTML • • 11h ago

How do I use map and filter on arrays in JavaScript?

0 Upvotes

I'm just starting out with JavaScript and I'm trying to understand how to use the map and filter methods on arrays. I have a simple array of numbers, and I want to create a new array that doubles each number and then filters out any that are less than 10. I thought I had it figured out, but I keep getting an empty array. Is there a common mistake I might be making with these methods?


r/HTML • • 22h ago

Question Offline uses for HTML (+ CSS)?

3 Upvotes

Last night, right before drifting into sleep, I got some crazy idea for some offline use case for HTML/CSS... But I can't remember exactly the idea that I had in mind.

It had something to do with photos or maps? I guess it was some "interactive" html/css based interface or mindmap kind of thing, about all the variety of stuff I have on my computer. For example, if I'm writing something, this file is its own separate entity. A file in "my documents", with no relation to any other file.

How about combining all of these files into this freeform "interface" by making an offline website that links into physical locations on my PC? I could organize my thoughts, my screenshots, my writings, my photos, my videos, my source materials, everything into a one personal use "platform" designed from the ground up to suit my workflow, that I could always expand.

Files would not be separate instances hidden in the files, but rather a part of a bigger system. Their links could be highlighted, they could have visual cues to direct my attention, they could have thumbnails or explanatory notes, they could be inbedded videos.

Has anyone ever attempted at making something like this?


r/HTML • • 18h ago

Question What is the best way of learning html?

8 Upvotes

So I have quite a story:

I found out that Ai could do code, I wanted to try it and I wanted to make my own game, then after 3 days (so today) I grew tired of it making the same mistakes, so I want to learn this so I can fix and hopefully continue this project myself.

It's a card game based on countries, I has a lot of complex meccanics but I want to fix it and continue to add stuff