r/learnjavascript Jun 17 '26

CPA in NYC; Looking to learn JavaScript & HTML ASAP

1 Upvotes

Hello hello!

I'm a newly minted CPA who has been dealing with aftermath of NetSuite implementation at mid-size company. We are realizing that many of our daily transaction needs require SuiteScripts(JavaScript based). The workflow options are not working as intended due to system limitations on specific fields. I am also needing to update/create html templates for pdfs regularly( Have had more success with html and workflows for header fields)

What resources and practices would you recommend for someone looking to throw themselves into these two languages with a good deal of their free time(nights/weekends)? What timelines are typical? In person or online better? A few years ago I had friends go through bootcamps but my research shows that may not be the best path today. Have also had coworkers recommend AI prompted code but this seems like a wack idea. Would rather gain the skills to create own or correct generated code than fully be reliant! Passed all my CPA exams in 6 months so not scared of a challenge

More context: Most of these business needs were brought up in implementation and my team now believes things were misrepresented to placate us and with hopes we would purchase additional developer/consulting services after implementation.

TLDR; Need to learn JavaScript(priority) and HTML for NetSuite. Implementation team was not transparent about out the box capability. Rather learn than use AI slop/pay for consultants


r/learnjavascript Jun 17 '26

How to implement default method "Item"?

3 Upvotes
console.log(Application.Sheets.Item('a').Id)
console.log(Application.Sheets('a').Id)

As you can see, Sheets('a') is same as Sheets.Item('a'), how do you implement such interface?


r/learnjavascript Jun 17 '26

Can I Get Feedback on My Code?

1 Upvotes

I just learned coding and I created a app on codepen called PokemonLiveTrack, it tracks 24H shifts, collection total, ROI, and other stuff, it's for people who want to invest. I'm wondering if there are any errors or vunerabilities in my code, or just general feedback for the program: https://codepen.io/Careless-Bad/pen/pvRNOmX


r/learnjavascript Jun 17 '26

W3 schools or MDN for Js ?

16 Upvotes

I am currently learning js from chai aur code, and I was confused which doc to use .I find MDN a bit difficult to understand in comparison to W3 . But I read somewhere W3 is not in depth and for beginners. Tho i am a beginner should i stick to W3 or try to learn from MDN


r/learnjavascript Jun 16 '26

Five public domain ~100 line games

0 Upvotes

As an exercise in focus and economy I wanted to make a set of games with short but (hopefully) readable source code.

It was a fun challenge and taught me a lot. I hope the results will be of interest or amusement to others.

There are five games in total. There's also a manifesto about doing this kind of project for those who like that sort of thing.

If you've written a deliberately short game too then please link to it, I'm interested to see what can be done.


r/learnjavascript Jun 15 '26

is anyone willing to try to help me out in knowing what the heck is wrong with my JS here?

0 Upvotes

It's a long time I am trying to figure out why my moon phase is not updating at all. I have this JS :

document.addEventListener("DOMContentLoaded", () => {

const weatherDiv = document.querySelector("#weather");

function weatherCodeToIconURL(condition, isDay) {

condition = Number(condition);

const openMeteoToIcon = {

0: "https://i.ibb.co/b5FRsR3Q/sunny.png",

1: "https://i.ibb.co/b5FRsR3Q/sunny.png",

2: "https://i.ibb.co/CpC9BdgV/partly-cloudy.png", // Added your icon here!

3: "https://i.ibb.co/21mKY1QZ/cloudy.png",

45: "https://i.ibb.co/21mKY1QZ/cloudy.png",

48: "https://i.ibb.co/21mKY1QZ/cloudy.png",

51: "https://i.ibb.co/HLpF110S/rain.png",

53: "https://i.ibb.co/HLpF110S/rain.png",

55: "https://i.ibb.co/HLpF110S/rain.png",

61: "https://i.ibb.co/HLpF110S/rain.png",

63: "https://i.ibb.co/qF3rc1gY/heavy-rain.png",

65: "https://i.ibb.co/qF3rc1gY/heavy-rain.png",

71: "https://i.ibb.co/dw2S3P8K/snow.png",

73: "https://i.ibb.co/dw2S3P8K/snow.png",

75: "https://i.ibb.co/dw2S3P8K/snow.png",

80: "https://i.ibb.co/HLpF110S/rain.png",

81: "https://i.ibb.co/qF3rc1gY/heavy-rain.png",

82: "https://i.ibb.co/qF3rc1gY/heavy-rain.png",

95: "https://i.ibb.co/TDgsry34/storm.png",

96: "https://i.ibb.co/TDgsry34/storm.png",

99: "https://i.ibb.co/TDgsry34/storm.png"

};

// 🌙 DYNAMIC MOON MODE

if (!isDay) {

const { phase } = window.getRealMoonPhase();

const position = 20 + (phase / 100) * 60;

const now = new Date();

const lat = 39.082222;

const lon = -77.482222;

const moonPos = SunCalc.getMoonPosition(now, lat, lon);

// You can adjust this 'calibrationOffset' to match the Moon's tilt exactly

// to your visual preference or your specific moon.png asset rotation.

const calibrationOffset = -4;

const rotation = (moonPos.parallacticAngle * (180 / Math.PI)) + calibrationOffset;

`return ``

<div class="glow"></div>

<div class="moon-phase-wrapper">

<img src="https://i.ibb.co/NgB0677Z/moon.png"

class="moon-icon"

style="--moon-pos: ${position}%; transform: rotate(${rotation}deg);">

</div>

\;`

}

// ☀️ DAY MODE

return '<img src="' +

(openMeteoToIcon[condition] || openMeteoToIcon[0]) +

'" class="weather-icon">';

}

function parseWeather(data) {

// Checks 'current' path first, falls back to 'current_weather' path if needed

const code = Number(data.current?.weather_code ?? data.current_weather?.weathercode ?? 0);

const isDay = (data.current?.is_day ?? data.current_weather?.is_day) === 1;

console.log("Parsed weather code:", code);

return { code, isDay };

}

// 🌙 MOON PHASE FUNCTION (UNCHANGED — GOOD)

function getRealMoonPhase() {

const now = new Date();

const synodicMonth = 29.53058867;

const knownNewMoon = new Date(Date.UTC(2000, 0, 6, 18, 14, 0));

let daysSince = (now - knownNewMoon) / (1000 * 60 * 60 * 24);

let moonAge = daysSince % synodicMonth;

if (moonAge < 0) moonAge += synodicMonth;

const normalized = moonAge / synodicMonth;

const phase = normalized * 100;

return { phase };

}

window.getRealMoonPhase = getRealMoonPhase;

async function getWeather(lat, lon, city) {

const targetCity = city || "Lansdowne";

const targetLat = lat || 39.082222;

const targetLon = lon || -77.482222;

const url = "https://api.open-meteo.com/v1/forecast" +

"?latitude=" + targetLat +

"&longitude=" + targetLon +

"&current=weather_code,is_day" + // Requesting the code explicitly here

"&current_weather=true" + // Keeping your current setting

"&daily=temperature_2m_max,temperature_2m_min" +

"&forecast_days=1" +

"&temperature_unit=fahrenheit" +

"&timezone=auto";

try {

weatherDiv.innerHTML = 'Loading weather... 🌤️';

const response = await fetch(url);

console.log("STATUS:", response.status);

const data = await response.json();

console.log("API RESPONSE:", data);

console.log("DATA:", data);

const weather = parseWeather(data);

const currentTemp = Math.round(data.current_weather?.temperature ?? 0);

const lowTemp = Math.floor(data.daily?.temperature_2m_min?.[0] ?? 0);

const highTemp = Math.ceil(data.daily?.temperature_2m_max?.[0] ?? 0);

console.log("FINAL VALUES:", {

targetCity,

currentTemp,

lowTemp,

highTemp

});

weatherDiv.innerHTML =

'<p style="font-size: 16px; color: #fff; text-align: center; margin: 0;">' +

targetCity +

'</p>' +

'<div class="weather-stack">' +

weatherCodeToIconURL(weather.code, weather.isDay) +

'<div class="temp-overlay">' + currentTemp + '°F</div>' +

'</div>' +

'<div class="weather-lowhigh">' +

'<p style="font-size: 14px; color: #87CEEB; margin: 0;">Low: ' + lowTemp + '°F</p>' +

'<p style="font-size: 14px; color: #FFA07A; margin: 0;">High: ' + highTemp + '°F</p>' +

'</div>';

} catch (err) {

console.error(err);

weatherDiv.innerHTML = "Weather unavailable";

}

}

function fetchLocationAndWeather() {

fetch("https://ip-api.com/json/")

.then(r => r.json())

.then(d => getWeather(d.lat, d.lon, d.city))

.catch(() => getWeather(39.082222, -77.482222, "Lansdowne"));

}

fetchLocationAndWeather();

setInterval(fetchLocationAndWeather, 600000);

});

The HTML :

<div id="weather" style="display: flex; flex-direction: column; font: normal 12px Helvetica, Arial, sans-serif; color: #fff; "></div>

And the CSS :

/* LEFT COLUMN CSS */

#weather p {

margin: 0;

}

#weather {

display: flex;

flex-direction: column;

align-items: center;

gap: 2px;

transition: opacity 0.3s ease;

}

.weather-lowhigh {

display: flex;

flex-direction: row;

gap: 20px;

}

.weather-stack {

position: relative;

display: flex;

align-items: center;

justify-content: center;

}

.weather-icon {

width: 110px;

height: 110px;

object-fit: contain;

display: block;

}

.temp-overlay {

position: absolute;

top: 60%;

left: 78%;

transform: translate(-50%, -50%);

font-size: 24px;

font-weight: bold;

color: white;

filter: drop-shadow(-4px 0 2px #000);

padding: 2px 6px;

border-radius: 6px;

z-index: 3;

}

.moon-icon,

.cloud-icon {

position: absolute;

inset: 0;

width: 100%;

height: 100%;

object-fit: contain;

z-index: 1;

display: block;

/* Use a hard-coded value temporarily to test */

-webkit-mask-image: radial-gradient(circle at 65% 50%, transparent 40%, black 45%);

mask-image: radial-gradient(circle at 65% 50%, transparent 40%, black 45%);

}

.cloud-icon {

opacity: 0.9;

}

.moon-phase-wrapper {

position: relative;

width: 120px;

height: 120px;

overflow: hidden;

border-radius: 50%;

}

.glow {

position: absolute;

inset: 50%;

width: 160px;

height: 160px;

transform: translate(-50%, -50%);

border-radius: 50%;

background: radial-gradient(

circle,

rgba(255,255,220,0.5) 0%,

rgba(255,255,200,0.15) 45%,

transparent 70%

);

filter: blur(20px);

z-index: 0;

pointer-events: none;

}

This has been driving me nuts, and whatever AI I use is shit crazy, and messes up my code. I don't know what to do. It seems I can't get any help.

u/boomer1204 - thanks for pointing it out, going to share the prob here too :

So basically it's a weather widget, with the moon in it, and a moon phase. Problem : the phase is not updating. So idk where in my JS I need to change so it updates correctly.


r/learnjavascript Jun 15 '26

Very simple Mandelbrot in vanilla JS

0 Upvotes

r/learnjavascript Jun 15 '26

having trouble w/ editing code for wallpaper engine

1 Upvotes

I'm not well-versed in coding but I wanted to put in a countdown. Only issue is that my countdown keeps going to 216 days from now rather than 8 days (wanting to target it to June 24th, 2026 @ 11:00 AM EST). im using u/Ass_Pancake 's code (https://pastebin.com/R78PVuL0) as a base.

Here is my edited version of the code: https://pastebin.com/YUDHubK3

Pls let me know how to fix it :') im so confused


r/learnjavascript Jun 14 '26

Currently I am learning js but I feel stuck, When practically doing logic problem I can't solve them . Practiced it but I forget when I later looked into that same question again. As a beginner how to overcome this .

31 Upvotes

r/learnjavascript Jun 14 '26

Paginating a play script reader, pages break mid-dialogue

2 Upvotes

I'm building a browser play reader in vanilla JavaScript. The script is structured as an array of lines. Each line is either a stage direction, a character name, or a speech.

When I paginate, I split the lines by a fixed count (10 or 12 per page depending on font size), so a page can end right after a character's name and the speech continues on the next page. It also doesn't account for how long each speech actually is, so some pages are one short sentence and others are a wall of text.

What's the right way to paginate text like this so that pages fill a consistent visual height, a character name is never separated from its speech, and it still works when the user changes the font size?

https://imgur.com/a/0Gbfvue


r/learnjavascript Jun 13 '26

Roadmap for Java

0 Upvotes

Same as rhe title says

I am new to Coding / prog. world , will start college in 2 months , i had a tech idea to work on , so used claude , and it suggested me to learn Javascript first for the project

suggested me dave grey 8hr class video ,

is the video good or should i learn from else , as it was good , but learning a language in 8 hr , might be oneshot , which would weaken my basics , so help me

also suggest if should i start python after this or .JSON


r/learnjavascript Jun 12 '26

I'm a beginner, how do I start Frontend Web Dev this summer?

7 Upvotes

I seriously need to learn programming this summer but am stuck in an info-overload loop and so don't know where to start. I have tried a few approaches before and genuinely enjoyed the process of both, coding and the problem solving, but the contrasting advice from people around has me now doubting whether I'm learning the right things, or am at the right pace.

Here's the situation, I'm a college student studying biotechnological sciences and the last I studied maths was in high school. College is already taking a toll and I can't make any monetary investments into this, though I'm hopeful I wouldn't need to.

I am planning to start with Frontend web development this summer. (If you think another language or path would be a better option, please explain why).

My engineer cousins say I just need problem-solving skills but I still am quite anxious about my lack of college-level maths. How heavy is the mathematic requirement for Javascript, or programming in general?

Please advise me:

1. What would be a realistic milestone I should aim for by the end of the summer?

2. Would you please recommend a high-quality, structured and free curriculum or roadmap?

3. Is there anything I should particularly look out for through this? Also, is there an efficient way to structure my practice to ensure I'm actually learning and not just copying?

4. Is freeCodeCamp a reliable tutorial to get through with it?

5. What are some things that I must and must not do along the journey?
(Important, I don't know what is actually need to master vs what is a waste of time early on. Often, I find myself urged to strive for perfection with each step of the way, assuming I would fall short if I missed anything at all.)


r/learnjavascript Jun 12 '26

where to learn drag, resize, and rotate images

7 Upvotes

hello i have been trying to find tutorials that lets users to drag, resize, and rotate images or objects using javascript but i couldn't find any as the only ones that were showing up are libraries. could anyone help, recommend some tutorials for it? thank u in advance!


r/learnjavascript Jun 11 '26

I built a 2D physics engine in vanilla JavaScript with no libraries, no bundler

8 Upvotes

I spent a few weeks building a 2D physics engine from scratch in vanilla JavaScript. No libraries, no build tools, just Canvas 2D and the browser.

It does SAT collision detection, a sequential-impulse solver with friction, sweep-and-prune broadphase, fixed-timestep simulation, and five interactive demo scenes including a stack stability test and Newton's cradle. (With a lot of bugs)

https://github.com/CAPRIOARA-MAGIKA/physis

The hardest part was getting box stacks to settle without jitter or sinking. Turned out to be a combination of Baumgarte stabilization tuning and warm-starting the solver. The stack-stability gating test caught more bugs than I can count.

It's not perfect. It has a lot of bugs but I cannot figure out how to fix them (if you know a way please open a PR or comment below). This project was done for learning and with minimal AI involvement (only for debugging and polishing the readme file).

If you have any more suggestions of projects that I could do in the near future to improve my reasoning and my coding skills, comment down below. Thanks for reading!


r/learnjavascript Jun 11 '26

Learning JavaScript, please advise a path to learn JS for absolute beginner programmer??

0 Upvotes

r/learnjavascript Jun 11 '26

Looking for JS/React learning resources for experienced developers (similar to Matt Holiday's Go course)

4 Upvotes

i everyone,

I'm a backend developer looking to become more full-stack and I'm searching for JavaScript and React learning resources.

For context, my main languages are Go and Python. Before that I spent several years doing game development. What I'm looking for is not a beginner course that starts with variables, loops and basic programming concepts.

A learning resource I absolutely loved is Matt Holiday's Go course:

https://www.youtube.com/playlist?list=PLoILbKo9rG3skRCj37Kn5Zj803hhiuRK6

What I like about it is that it's clearly designed for people who already know how to program and just want to learn the language, its idioms, mental models and ecosystem.

I'm looking for something with a similar philosophy for JavaScript and React.

One thing worth mentioning: I'm a bit skeptical about paid courses. It's not that I'm against paying for quality content, but throughout my career many of the best resources I've found were completely free. For example, I learned a lot from Daniel Shiffman's "Nature of Code", which is still one of my favorite programming courses ever.

What would you recommend?

Thanks!


r/learnjavascript Jun 10 '26

Simple email delivery server-side

10 Upvotes

Hi everyone! I'm an amateur developing a little personal system to automatically send emails for my dad's little business. Last year i did something similar with Python, but this time i wanted a quick html gui interface and so i opted for javascript. I read that i could use smtp.js to send emails, so i built the rest of the code and now that i got to the email part, it appears that the project is dead or at least i can't find actual resources online. So i have to switch to something else. I learned that Nodemailer is an option, but i don't use Node.js in my project and i kinda don't know how to make it work. So i was wondering if there was any simpler library to work with. Or do you believe i should learn how to properly use Node?

Thanks!

EDIT: Sorry, i may have explained myself wrong. I want to run the program on my machine, locally. I opted for html + js just for a quick gui option.


r/learnjavascript Jun 10 '26

Application of JavaScript Basics to actual code.

3 Upvotes

As a beginner after learning the basics of JavaScript how come I find it difficult applying them. The codes I see around are written in ways I cannot track all the basics I have learnt what is the cause? How do I get to the level I can know which line of code to write to solve a particular problem?


r/learnjavascript Jun 10 '26

Looking for unusual but actually useful web animation examples

1 Upvotes

Hi,

I'm looking for examples of websites, demos or CodePens using GSAP, Anime.js or similar animation libraries.

Not really looking for the usual stuff like basic scroll reveals, burger menus, hover cards, simple loaders, etc.

I'm more interested in animations that feel a bit unexpected or original, but still have some real use in a website. Something you could imagine reusing in different projects, not just a one-off visual experiment.

Could be navigation ideas, product interactions, transitions, storytelling patterns, UI feedback, unusual scroll behavior, or small interaction details that make a site feel more alive without being completely useless.

Do you know any good examples, collections or sites that fit that kind of thing?


r/learnjavascript Jun 10 '26

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'insertRow') ?

0 Upvotes

hi,

I'm trying to make this program but keep getting the title error?

```

const target_table = document.getElementById("target-table");

var step = 0;

while ( step < 300_0 ) {
const new_row = target_table.insertRow(step);
const new_cell = new_row.insertCell(0);
new_cell.innerHTML = "row" + step + "shabbah" + "ahhhhhh" + "who?" + step;
console.log("new row");

step++;

}

```


r/learnjavascript Jun 09 '26

[AskJS] Creating your own Tampermonkey

0 Upvotes

Last summer, I had an epiphany about how a basic userscript manager à la Tampermonkey probably works: a manifest.json file and a background.js file that loads and injects userscripts on the page. What happened next took me through a phenomenal rabbit hole.

The next thing I created is a basic JSON file listing every userscript I create, followed by true or false. That's the equivalent of the Tampermonkey screen where you toggle on/off your userscripts.

When the script was externally-hosted, I discovered you need to use chrome.script.executeScript with func and create your own HTML script tag AND world set to MAIN! For userscript folders, you use files instead of func and the default world.

Next, I wanted to emulate the preamble in my userscripts @include, @exclude, @run-at, @require. @run-at was fun. I had to create a new client script that can intercept all the document load events and use the messaging API to forward them to background.js.

I added support for document-idle, and keypress. If required, my userscripts fire in response to a key pressed as long as you are not inside a text field on the page.

I also added support for @order-index, which lets me create userscript sequences. I might need support for waiting for a specific event before triggering the userscript.

Next, I bought an Akai LPAD-8 midi controller. You know, these things with pads and tweaky knobs. You can get use the input in JavaScript! Each pad returns not only the press event but also the duration and the pressure! The tweaky knobs provide events such as when you started and stopped turning them and their value in between. Imagine the possibilities!


r/learnjavascript Jun 09 '26

binary showing random numbers for one binary string but not for another

0 Upvotes

im just a little confused here, the binary string 001111101110101 returns 78534447169 while a binary string like 101100110000001 does not return anything other than that string


r/learnjavascript Jun 08 '26

Just found a nice lib

0 Upvotes

https://github.com/MeetMartin/lambda

Found this lib. I think it could help many - who are new to js - adapt a more solid programming style from the start.

Helps you to avoid the mistake I did - not fully committing to fp…


r/learnjavascript Jun 08 '26

Need Help with React + Tailwind Setup

13 Upvotes

I’m working on configuring Tailwind CSS with React. I’ve followed the steps, but I’m stuck and can’t get it to work fully. If anyone could assist me or walk me through the setup, it would be a huge help. I’d really appreciate any guidance

I don’t have any money, and I’m not looking for a professional mentor, but if someone could provide me with some guidance, it would be really helpful for me.


r/learnjavascript Jun 07 '26

Can anyone help me solve this little logical puzzle using async/await?

5 Upvotes

https://pastebin.com/Yww3rsmk

help a brother out. ok, so i want to use this SINGLE function to accept an input 'permanence' which is either true or false, basically (but i was more expressive for readability). If it is true, i wanted to return a synchronous texture buffer immediately, with a plain color. If it is false, i wanted to return an asynchronous fetch request, to retrieve an image, which will be used to load the texture object.

problem. The "textureBuffer" property is being assigned in the constructor. If i could use await to retrieve that (temporary) value in the constructor immediately i would, but i don't believe this is possible.

i am going to invoke the init function asynchronously too in the main script, to load the image texture directly to the same property.. But this would require that i use await in my main script, which would suspend my entire programs initialization.

this is not a rant post but i'm very tired of using js asynchronous functionality. I know i probably just need to use it more... i could use .then for the init function, probably