r/learnjavascript • • Jan 23 '26

Anyone got code for a scientific calculator like this? Hey, I want to try building a scientific calculator in JS/HTML/CSS. Seen a video showing one and it looks fun to make https://www.youtube.com/shorts/R6pGof6vVUY

0 Upvotes

Anyone got an example or tips to get started?


r/learnjavascript • • Jan 23 '26

1st yr, Self-taught learner requires feedback and guidance

5 Upvotes

Hey people, I'm 11 months into js and a few months into html and css.

I'm hoping I can ask you guys to have a look at this mini project I knocked up. It's nothing massive but Ive been trying to focus on things like event driven logic and turn based flow.
It's all in vanilla js and html as I wanted to learn to handle types and state before I step over to using tools like ts and react (dunno if it's the right choice)....

Anyway, this is my first upload to redit so I had to put this codebase on a separate repo for public view, by all means take it and have a use, theres a basic ui/ix for notes, levelling, shopping and battle. But mainly I'd love if you guys could look at how I structure code and name things.
I'm not at this for a job, in 47 😎 and just learning to pay back the 16 yr old me that never got to finish... Sappy shit? Yes, I hear that..

But please, be honest and have a look.

And thanks for all this.

Repo:-
https://github.com/Chefiroth/Noteish1.2-Public-Review

Blessings!


r/learnjavascript • • Jan 23 '26

What is typical approach of lookup table based on 3 integers?

2 Upvotes

Hi, I am trying to figure out how to store a value that gets looked up based on 3 integers.

I have this:

var objexists = fast_lookup_table?.[int1]?.[int2]?.[int3];

if (objexists === undefined) {

fast_lookup_table[int1-1]=[];

fast_lookup_table[int1-1][int2-1]=[];

fast_lookup_table[int1-1][int2-1][int3-1] = [val1, val2];

}
At this point in code int1, int2, int3, val1, val2 are available. But logging shows me this is not populating the array.

Also, I understand there are probably better ways to do this, as I was just reading about lookup maps, but everything I am seeing shows these maps based on a single lookup key. If that is the best way, do I then simply create a string key such as 'int1:int2:int3'?

thanks


r/learnjavascript • • Jan 23 '26

Best way to learn JavaScript properly in the age of AI?

0 Upvotes

I recently completed a full-stack course, but I still struggle with JavaScript fundamentals.

I can follow tutorials, but when it comes to writing logic on my own, I get stuck.

With AI tools like ChatGPT and Copilot around, what’s the best way to *actually* learn JavaScript instead of just relying on AI?

Any advice, resources, or learning strategies would help.


r/learnjavascript • • Jan 22 '26

Help with Objects

4 Upvotes

I don't get the purpose of value()

let dictionary = Object.create(null, {
  toString: { // define toString property
    value() { // the value is a function
      return Object.keys(this).join();
    }
  }
});

Why we can't make it work like this?

toString: {
      return Object.keys(this).join();
}

r/learnjavascript • • Jan 22 '26

Ways to learn JavaScript - Interviewees Wanted

0 Upvotes

Hi all!

I am building a new, free way of learning JavaScript.

I wanted to discuss with JavaScript newbies about their experience. I will pay $30 per 45 minute interview.

You can sign up here. https://calendly.com/josh-wolff-7/letschat


r/learnjavascript • • Jan 22 '26

How to check if archive format password protected / encrypted ?

1 Upvotes

Hello everyone, i have a task - i need to check if archive formats (eg. arj, zip, 7z, rar, tar, tgz) are password protected - encrypted. I have a React TS app.
My app allows users to work with files - upload, download, and edit them. And when someone upload encrypted archive i need to somehow save this info (maybe "isPasswordProtected" field or smth) and when other, different user click on this archive - i need to show in interface that archive is password protected (info bubble or smth)

BUT the main questions are:

  1. how do i check if archive is encrypted without unzipping it or just partly unzip it?
  2. Does provided archive formats has some kind of headers or smth like that? For example - if i want to check it on server - what exactly i need to check for?
  3. How to check it on client-side(frontend) ?

If u can, please, share some info or links or how file/archive should look like bc i think im a little lost right now


r/learnjavascript • • Jan 22 '26

Is it possible to check if a function with a specific parameter signature(?) exists?

0 Upvotes

Just curious - I know I can check if a specific function exists with

if (typeof myFunction !== "undefined") ...

Let's say myFunction could either be function myFunction() or function myFunction(parameter1), depending on which version of a library is loaded. typeof myFunction returns "function", is there a way to know if it's myFunction() or myFunction(parameter1)?

(Not sure if "parameter signature" is the right terminology)


r/learnjavascript • • Jan 21 '26

Help me 😭😭

11 Upvotes

Hi everyone, I've been practicing Javascript for at least 3 months now, sometimes I don't understand what's happening or how to solve the code. My mind gets fucked everytime thinking about the code, even after writing the code I get syntax error which than frustrates me more. I just get very very angry at myself for not understanding it. I don't know how to solve the code or build the logic while writing it.

I don't know what to do, I'm thinking of taking the Javascript: Algorithms and Data Structures by Colt steele for better understanding of Javascript.

Help me guys...


r/learnjavascript • • Jan 21 '26

Is there a way to have payload validation with json-server?

1 Upvotes

I'm trying to create an api testing project for a portfolio, and json-server is great for showing when things go well, but since I'm in QA so I want to test things not going well like unauthorized access and missing required fields/not matching the schema. Is that possible with json-server or will I need to learn how to make an actual API to do this?


r/learnjavascript • • Jan 21 '26

trigger a keyup event with javascript?

1 Upvotes

I have a browser-side userscript that will fill in a forum input value on an external website that's not mine. It's a search bar. However, there's no 'search' button; the search is fired whenever there's a keyup event in the focused search bar.

The code I'm using so far is this. It properly fills in the input field, but since there's no keyup event, the search function never fires.

document.querySelector(".input_class > input").value = "text";

I feel like there has to be a simple way to fix this. Does anyone have any ideas?

EDIT: Solved! This is what worked for me:

        // search for item
        let input = document.querySelector(".class > input");
        let searchTerm = input.value = valueList;
        console.log("Label:", searchTerm);
        input.focus();
        
        // simulate keyup event to fire search
        let keyUp = new KeyboardEvent('keyup');
        input.addEventListener("build", (e) => {
            /* … */
        });
        input.dispatchEvent(keyUp);

r/learnjavascript • • Jan 21 '26

Procurando ajuda para aprender javascript.

0 Upvotes

Olá tenho alguns cursos na área de ti porem nunca trabalhei com programação, tenho vago conhecimento em Java script e no momento não tenho grana para contratar cursos para aprender a programar, alguém pode indicar formas para eu poder aprender e praticar, obrigado!


r/learnjavascript • • Jan 21 '26

what is a dependency?

0 Upvotes

I am making a video game mod, and although the tools to do that are not complex. I want to run a mod that has a java jar that uses... The whole game as a dependency. Specifically Starsector. How do I do that?

edit: you know what, I'll just read a book. Sorry for wasting your time, this question is too stupid

edit2: wait... This is the wrong subreddit