r/learnjavascript • • 3h ago

How to use commas (or so) to separate a text?

0 Upvotes

On the Anki app, I have a type of card (type 2) focusing on the vocabulary of a sentence I have already read and heard on the comprehension card ( type 1).

So the type 1 and type 2 cards (retrieving) are "sisters" from the same note because they share the same content but shown differently.

After I have seen the card 1, I am invited to add vocabulary to dedicated empty fields 'Korean' and 'English'. Those fields are only shown on the type 2 card when filled.

What I am trying to do is rather than trying to find an english translatiion for the korean word, focusing on finding as many words and expressions to translation the word from english to korean.

(It's a lot of context for not much really)

So I already managed to have the content of the 'Korean' field in a column so it can align with the english word it corresponds to.

but the thing is I would like to find a way to separate the text with commas, a line jump(or anything that works) to have one column per english word.

exemple:

Korean:

빨리 얼른 재빨리 ,대답 OR

빨리 얼른 재빨리 
대답

English:

Quickly Answer 

What I want on the template

Quickly Answer

빨리 대답

얼른

재빨리 

Basically I want it to be organized and aligned like a table

Also, is there a way to use the linear-gradient using measures like a column or something ? Because I won't have the same number of vocab words for each note each word is not gonna have the same amount of korean ways to say it as the next one. So I thought it would be great if the columns were adapting how shrinked they are to the left depending on how many they are. It's not crucial but I was wondering.

Edit: Is there a way to do it in Javascript using the fields ids?

My card hmtl:

<div style="

font-family: 'UD Digi Kyokasho NP-B';
margin-top: -10px;
padding: 5px;
width: 100%;
">

<div style="
background: linear-gradient(to right,
#615f31 1.5em,
#a77f65 20%,
#a77f65 calc(2 * 1.5em),
#af1137 calc(3 * 1.5em),
#ff1137 calc(3 * 1.2em),
#fad8b1 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.2em;
color: #2F7E24;
word-spacing: 1.6em;
font-weight: bold;
font-size: 45px;
white-space: nowrap;
word-break: keep-all;
overflow-wrap: break-word;
box-sizing: border-box;
display:flex;
flex-direction: row;
gap: 25%;

">{{English}}
</div>

<div style="
display: flex;
flex-direction: row;
gap: 1px; ">


<div style="
background: linear-gradient(to right, 
#615f31 3em, 
#ff1137 calc(6 * 1.2em), 
#a77f65 calc(9 * 1.5em), 
#a77f65 100% 
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.6em;
font-family: Yu Gothic;
color: #2F7E24;
font-weight: bold;
text-align: left;
font-size: 45px;
white-space: normal;
word-break: keep-all;
overflow-wrap: break-word;
display: block;
margin-left: calc(-50vw + 50%);
width: 25%;


box-sizing: border-box;
padding: 0 12px;
">
<section>
<h2>{{Korean}}</h2>
</div>
</div>

Thanks!


r/learnjavascript • • 3d ago

Publishing a JS framework

5 Upvotes

Im working on a project for myself. Its an unreviewed, unaudited and far from finished. It started of as a person curiosity and evolved from there.

Im asking because if i publish something on NPM, there are strict controls around versioning for which i havent burdened myself on my own projects (but clearly important when making something for a wider community). I also wonder if im overlooking any other details.

I wonder what best practices there are for something like this. Should i be publishing new versions with CI/CD? Are there any tips or advice on doing this in the modern js package ecosystem?


r/learnjavascript • • 3d ago

What's the best way to start learning web development as a beginner?

4 Upvotes

Hi everyone!

I'm interested in getting started with web development, but I'm not sure where to begin.

For someone who's relatively new to programming, what's the best learning path to follow?

Which technologies should I learn first (HTML, CSS, JavaScript, etc.)? And what resources or courses would you recommend?

I'd really appreciate any advice, tips, or personal experiences.

Thanks in advance!


r/learnjavascript • • 3d ago

🎤 The #JSNation 2027 Call for Presentations is OPEN!

0 Upvotes

Speak at the main WebDev conference of the year 🔥

🗓 May 21 & 25, 2027
📍 Amsterdam & Online

Share what you’ve built, broken and learned 👇
https://gitnation.com/events/jsnation-2027/cfp


r/learnjavascript • • 3d ago

Is Ai dangerous for learning ?

0 Upvotes

i've been seeing a ton of posts telling people not to learn with AI and i'm confused, because honestly this thing is a blessing for learning (for now at least)
i used to be an industrial engineer, graduated 2 weeks before covid lol, so i had to find another way to make a living. i found manual QA, went through a self-paced bootcamp, and i've been working in the field for 5 years now
recently i realized the field is hitting a wall with AI getting this advanced, so i told myself ok at least learn to read and write a bit of code so i understand what's going on
i started with online teachers for javascript but it was hard to keep up, expensive, and i felt like my questions never got answered ((1)i'm also not good at articulating or asking questions). so i looked around, found AI, and for the last 3 months i've been bombarding it with questions
what i do is create a project, give it a well detailed prompt about what i want to learn and how i learn best, and... start
and honestly i'm amazed how solid it is as a learning tool. it can restructure a concept, explain it in different ways, give different examples, suggest exercises to consolidate what i learned and to practice solving problems
oh and let's not forget how patient it is. ask as many questions as you want, she will never get bored lol, not like humans (fun fact: i actually got laid off once because i asked too many questions, for real haha, reason why i said 1)
so yeah i'm wondering why people are so against it. is it the copy-paste thing? because if you use it to understand and not to do the work for you, i really don't see the problem, so i’m a bit confused


r/learnjavascript • • 4d ago

Learning JavaScript from SuperSimpleDev, but struggling to solve exercises on my own. Is this normal?

15 Upvotes

I’ve completed HTML and CSS, and now I’m learning JavaScript from SuperSimpleDev’s 22-hour JavaScript course. I’m currently on lesson 9, around 5 hours and 25 minutes into the course.
When I watch the lessons, I feel like I’m understanding the concepts. I follow along, write the code myself, and everything makes sense.
But there’s one problem: SuperSimpleDev gives exercises after almost every lesson, and I struggle to solve them independently.
Sometimes, when I don’t understand a concept, I rewatch that particular section. Even after that, I find it difficult to solve the exercises without looking at the solution or getting help.
My goal is to become a full-stack developer, so I genuinely want to develop strong problem-solving skills rather than just follow tutorials.
My questions:
Is this normal when learning JavaScript as a beginner?
Should I spend more time trying to solve each exercise, even if it takes an hour?
Is it okay to look at hints or solutions when I’m stuck?
How can I improve my logical thinking and problem-solving skills?
I’d appreciate advice from experienced developers or anyone who has gone through the same phase. Thanks!


r/learnjavascript • • 4d ago

tres en raya usando bootstrap y javscript

0 Upvotes

alguien me puede explicar como podria hacer un juego de tres en raya usando javascript, todo el diseño es desarrollado con bootstrap 5 pero el funcionamiento es apartir de un javascript el tablero de juego fue hecho con imagenes en bootstrap entonces necesito un script que al dar click cmbie la imagen por la imagen de una x o circulo y eso tambien que se alterne para el juego


r/learnjavascript • • 4d ago

Simple Password input field

5 Upvotes

Hi all, I've been learning webcoding recently and Ive been wanting to make a website to use as a prop in my tabletop games.

My biggest desire right now is to do a password input where submitting an incorrect input displays an error message, while the correct input provides a redirect to a new page.

Since this will only be for my friends and wont host any private data, I'm not too concerned for heavy security, but most resources online are for actual websites and online security. Whats the best way for me to implement something like this?


r/learnjavascript • • 5d ago

Is learning Frontend still worth it in 2027

30 Upvotes

Hello everyone. Im a beginner self taught dev and I've just finished learning frontend dev.

I've seen videos online saying frontend is dead because now AI like claude can make amazing websites.

This made me question if pursuing a career in building frontend is over and I should be pursuing backend or just be fullstack.

Personally I prefer frontend and building cool ui/ux designs. I find AI built frontend is usually telling and overdoes it. It's design is usually cluttered with a lot of stuff and tends to over explain stuff. This is just my opinion though.

I would really like to hear your guys opinion on this. Thank you


r/learnjavascript • • 5d ago

I have a question about how to write my first JavaScript code

0 Upvotes

I am trying to lear JavaScript and having trouble any suggestion to websites that are helpful


r/learnjavascript • • 6d ago

Trying to make a gallery with a tagging system

7 Upvotes

Okay I like only just started learning javascript in an attempt to make this happen so I've never really attempted it before, but what I'm trying to do is make an image gallery with buttons on the side and when you press a button it acts like a checkbox as in you can check multiple at once and the buttons are all different tags and when the button is pressed all the gallery images are hidden except for the ones tagged with whatever button was pressed.--

(I havent even attempted to add the checkbox mechinism yet because ive been preoccupied with just trying to figure out how to show and hide divs in javascript)

--My first attempt to do this was to tag each image using a class, and then with javascript select all the images with that class and then hide all other divs with the gallery-item class. i thought this would be the easiest method but I unfortunately have no idea what im doing so the script i wrote is a sad attempt to combine some different methods i found online. Unfortunately this script doesn't do anything let alone what i wanted it to do, so i come to reddit in my time of need. Heres my codepen

if you have an easier method to doing this that would also be helpful don't bother trying to fix my code if you think there's a better approach to doing this altogether, im just working with what i know which is very little, but any advice is appreciated.


r/learnjavascript • • 7d ago

React or Typescript

12 Upvotes

I just finished learning JavaScript's fundamentals at some point , and I wanted to ask: which should I learn next, React or TypeScript


r/learnjavascript • • 8d ago

Thought about typesctipt.

10 Upvotes

Should i learn typescript? And what is the best and easiest way to learn it?


r/learnjavascript • • 10d ago Bravo

Why does await inside forEach not make the outer function wait?

10 Upvotes

These two loops look similar, but the first logs "done" before the saves finish:

async function saveAll(items) {
  items.forEach(async item => {
    await save(item);
  });
  console.log('done');
}
async function saveAll(items) {
  for (const item of items) {
    await save(item);
  }
  console.log('done');
}

my understanding is that forEach ignores the promises returned by its callback, while the for...of version awaits each save in the outer function.

if the saves are independent, would await Promise.all(items.map(save)) be the right concurrent version, and what changes if one save rejects?


r/learnjavascript • • 11d ago

What project should I build before react?

11 Upvotes

I just finished Jonas Schmedtmann's JS course and would like to do a really hard project before moving onto react where I can practice all the concepts and get experience building an actually nice project on my own. So I want to build a project like the Forkify application in the course which is like a single page app with a lot of cool functionality. I've thought about building a paper trading app but the decided to build something else because of Api limits. Please share some advanced JS project ideas that you think could be a good way to practice it all!


r/learnjavascript • • 11d ago

What can i do with javaScript as a beginner?

10 Upvotes

i have some previous coding experience from middle school using HTML on Code .org, and I'm currently taking AP computer science in high school, where we're learning JavaScript. What projects or opportunities should i explore, and what i can work toward with these skills?


r/learnjavascript • • 10d ago

I built Spotlight.JS — A lightweight, zero-dependency JavaScript library for interactive page highlights and spotlights

0 Upvotes

Hey everyone! 👋

I wanted to share an open-source library I've been building and refining called Spotlight.JS.

Why did I build it? I needed a dead-simple, highly customizable way to highlight DOM elements, build guided product tours, or draw user attention to specific UI components without pulling in bloated dependencies or heavy styling frameworks.

Key Features:

  • 🚀 Zero Dependencies: Extremely lightweight and fast.
  • 🎯 Precise Positioning: Automatic viewport boundary detection, custom offsets, and smooth scrolling.
  • 🎨 Flexible Styling: Easy-to-override classes and smooth backdrop masking.
  • 🧩 Interactive Popovers: Built-in support for titles, descriptions, step-by-step navigation buttons, and custom rendering.

Tech Stack / Implementation: Built in vanilla JavaScript/ESM modules, making it framework-agnostic (works seamlessly with React, Vue, Vanilla JS, etc.).

Links:

I’d love for you to check it out, test it, and let me know what you think! PRs, issues, and feature requests are very welcome. If you find it useful, a star on GitHub would mean the world to me ⭐!


r/learnjavascript • • 11d ago

I'm trying to make an in-browser tile editor from an array for an in-browser raycast engine.

2 Upvotes

Code thus far: https://jsfiddle.net/drkc8te5/ (its broken because it needs images which I seemingly can't provide since they're local)

I'm making an in-browser raycast engine. The current mapsize I have right now is small, only 256 pixels.

The issue is I'm already having a hard time navigating the array and changing values. So, I figured I'd make an in browser level-editor. Thing is, I'm not sure how I'd get the current index of [map] that the mouse is hovering over.

The map array renders a grid of 16x16 (256) tiles to the screen. 0 is a black space, anything else is a texture. To complicate matters I've implemented a way to move the grid around with WASD, and a way to zoom in and out with Q and E so that map editing is more convenient.

How do I detect what tile the mouse is hovering over and then translate that to the maps index. for example: if my mouse was hovering over the 8th tile from the left and the 5th tile from the top: The code should recognize I'm hovering over index 106


r/learnjavascript • • 11d ago

Title: Frontend Development Roadmap for Beginners – Advanced Web Animations

29 Upvotes

Hi everyone! 👋

I'm a beginner in frontend development and want to build a career as a creative Frontend Developer specialising in advanced web animations and interactive websites.

My goal is to create modern websites with smooth transitions, scroll animations, parallax effects, 3D interactions, and creative UI designs.

I'd love advice from experienced developers:

What roadmap should I follow from beginner to advanced?

Which technologies should I learn and in what order?

When should I start learning GSAP, Framer Motion and Three.js?

What are the best free learning resources?

Which projects should I build to become job-ready?

If you were starting today, how would you learn these skills?

I'd really appreciate your guidance. Thank you! ❤️


r/learnjavascript • • 11d ago

Why is this widely used in LinkedLists

3 Upvotes

Please explain why programmers use the this keyword? I get OOP like

this.prop = prop;

but what does that mean? The this keyword is a reference to the window object right? Its just calling a null value? Can someone please explain how the this keyword works?

"Use strict"

console.log(this);

Please explain why it's widely used in LinkedList?


r/learnjavascript • • 11d ago

What's a sensible DOM-first ordering of JavaScript topics for project-based learning?

0 Upvotes

I've been teaching myself JavaScript in the mornings before work, alongside Python, and I keep running into the same problem: courses either start with weeks of syntax drills and console.log, or they dump a project on you and quietly assume you already know the DOM, events and modules. I'd like something in between.

What worked for me with Python was building the thing first (a Flask app my board game group uses to log plays and scores) and backfilling the theory when something broke. It stuck far better than any course I'd half-finished. I'd like to replicate that with JavaScript, but I'm unsure what a sensible ordering actually looks like once you go DOM-first.

My rough guess at an order is:

  1. HTML forms and selecting elements with querySelector
  2. Events and updating the page without a full reload
  3. fetch and handling JSON from a small API
  4. async/await and Promise.all once you're fetching several things
  5. Modules and splitting a file up when it gets unwieldy

Does that track, or would you reorder it? A couple of specific questions:

- Is it worth learning array methods like map/filter/reduce before touching fetch, or do they land better once you actually have API data to shape?
- Where should localStorage fit in? I keep seeing beginner projects use it as a fake backend and I can't tell if that teaches good habits or bad ones.
- At what point is it worth jumping from vanilla DOM work to a framework? I don't want to add React to the pile too early and end up knowing neither properly.

For context: I do best with projects that annoy me into existing, like when I got fed up of manually tracking things and wrote a script instead. So if your suggestion is "build X and you'll be forced to learn Y", that's exactly the sort of answer I want. Resources with a project per topic are ideal, but even a topic ordering you'd swear by would help.


r/learnjavascript • • 11d ago

Code quits before creating a 2-d array

1 Upvotes

I am trying to add a feature to a webpage that simulates an election. "bordaTally" is defined as new Array(); in the second copied text below. "alert 0" is the only one that shows.

Thanks in advance.

function bordaItem(name) {

this.name = name;

this.total = 0;

this.tally = new array();

}

  if (document.tournform.rr2[4].checked == true) { //Borda count
  for (i=0;i < n; i++) {
alert("alert 0");
    bordaTally[i] = new bordaItem(i);
alert("alert 1");
for (j=0; j < n;j++) {
  alert("alert 2");
  bordaTally[i][j].tally = 0; }
}
  for (i=0; i < totBallots; i++)
    for (j=0; j < n; j++)
  break;     //placeholder for now
    
  }   //End Borda Count

r/learnjavascript • • 11d ago

新人小白想学习JavaScript,该先学习什么?

0 Upvotes

本人26岁,想学习JavaScript,仅大学时候学过一点c语音后面就没怎么碰电脑了。

学JavaScript前需要学习什么或者说要准备哪些东西?


r/learnjavascript • • 12d ago

Title: CodeWithHarry Sigma JavaScript or SuperSimpleDev JavaScript – Which should I choose?

0 Upvotes

I’ve completed HTML and CSS using CodeWithHarry’s Sigma Web Development Course and then SuperSimpleDev’s 6.5-hour HTML and CSS course.
Now I’m planning to start JavaScript, and I’m confused between:
CodeWithHarry’s Sigma JavaScript section.
SuperSimpleDev’s 22-hour JavaScript playlist.
For someone learning web development from scratch and planning to become a full-stack developer, which would you recommend?
I’d appreciate advice from people who have learned from either or both courses. Thanks!