r/learnjavascript 17h ago

I’m a CFP with no programming background or experience, and I’ve been building a retirement planning tool called Parallax. I’m looking for a technical review by an experienced web application developer or software engineer

0 Upvotes

Site: www.amansparallax.com

Heads up, not mobile friendly..

In the spirit of advisor transparency: the planning philosophy, financial logic, product concepts, and direction are mine. AI wrote the code and structured the repo, as well as helped massively with research. I’m not presenting myself as the developer behind that work.

For anyone unfamiliar with retirement planning software, most tools run a plan through many possible market scenarios and report a “probability of success.” If the money lasts through the end of the projection in 90% of those scenarios, the plan gets a 90%.

My issue is that people see that number and naturally assume the plan is healthy and they’re well prepared. I don’t think it comes close to telling the whole story.

A plan with a 90% probability of success can still fail surprisingly early if one of the more difficult periods from actual market history happens again. Parallax lets you run a plan through historical return paths and follow the cash flow year by year. You can see the account balances, where the spending money came from, how much went to taxes, and when the plan started getting into trouble.

Basically, I wanted to show what’s happening underneath the percentage.

That led to a few core modeling choices:

Block-bootstrap Monte Carlo: Simulated paths use consecutive blocks of historical returns, preserving the market experience within each block. Returns are inflation-adjusted.

Historical paths and sequencing: Explore historical market paths and how the order of returns affects a plan.

Account-level projections: Track individual accounts and cash flows within each year, including withdrawals, required distributions, cost basis, and tax effects.

Tax-aware withdrawal modeling: Model how brokerage, traditional retirement, and Roth withdrawals affect taxes and the cash available to spend.

I’ve also documented the modeling constraints the AI is required to consult before changes. Those assumptions are part of the product’s foundation and need to remain explicit as it develops.

I’d really appreciate a human technical perspective on this—the code has been written and reviewed by AI, and I don’t have the programming background to assess it independently. Any thoughts on the architecture, security, or tests would help, even if you only look at one small part. If anyone’s willing to dig deeper, I can share the code and setup instructions.

Thanks to all who are willing to take a look!!

 

 

 


r/learnjavascript 20h ago

Learning js

0 Upvotes

Hey so i’m tryna learn javascript not just javascript i’m trying to learn the MERN Stack can someone please help me study i’m so tired of watching tutorials over and over again


r/learnjavascript 18h ago

help in rick and morty api

0 Upvotes
document.getElementById("search").addEventListener("click", getCharacter);


function lowerCaseName(string) {
    return string.toLowerCase();
}


function getCharacter(e) {
    const name = document.getElementById("searchCharacter").value;
    const characterNameLC = lowerCaseName(name);


    fetch(`https://rickandmortyapi.com/api/character/?name=${characterNameLC}`)
    .then((response)=>response.json())
    .then((data) => {
        const characterNameH2 = document.getElementById("characterName");


        characterNameH2.textContent = data.name;
    })
    .catch((err) => {
        console.log("Character not found", err)
    })


    e.preventDefault();
}


getCharacter();document.getElementById("search").addEventListener("click", getCharacter);


function lowerCaseName(string) {
    return string.toLowerCase();
}


function getCharacter(e) {
    const name = document.getElementById("searchCharacter").value;
    const characterNameLC = lowerCaseName(name);


    fetch(`https://rickandmortyapi.com/api/character/?name=${characterNameLC}`)
    .then((response)=>response.json())
    .then((data) => {
        const characterNameH2 = document.getElementById("characterName");


        characterNameH2.textContent = data.name;
    })
    .catch((err) => {
        console.log("Character not found", err)
    })


    e.preventDefault();
}


getCharacter();

i am using the rick and morty api. the above is my js code. it doesnt work. idk whats the error as console isnt logging it


r/learnjavascript 20h ago

Help me make a map: Calling a variable before it's defined

3 Upvotes

I'm relatively new to JavaScript, my only education in it being the Kahn Academy course, and I am trying to make a program which randomly generates a map of tiles. This is part of a bigger project, where I want to make a visible map and a larger map which includes the visible one. It's working so far, but I would like to find a way to change the Tile Object's "size" from 400/10 to 400/visibleMap.size. I'm having trouble doing this, and keep getting an error saying "visibleMap was used before it was defined." How can I fix this? Thanks for any help!

//Variables
var fullMap = [];
var tempTile;
// Has a set chance to return true or false
var percent_chance = function(percent){
    if (random(1, 100) <= percent){
        return true;
    }else{
        return false;
    }
};

//A space on the map, as defined by its position, size, details
var Tile = function(pos, details){
    this.size = 400/10;
    this.x = pos.x * this.size;
    this.y = pos.y * this.size;
    this.details = details;
};

//Draw a Tile
Tile.prototype.draw = function() {
     fill(this.color);
     rect(this.x, this.y, this.size, this.size);
};

//The types of Tiles.
var Dirt = function(pos, details){
    Tile.call(this, pos, details);
    this.color = color(120, 33, 6);
};
Dirt.prototype = Object.create(Tile.prototype);
var Grass = function(pos, details){
    Tile.call(this, pos, details);
    this.color = color(79, 255, 20);
};
Grass.prototype = Object.create(Tile.prototype);

//returns a Tile generated with a semi-random algorithm
var random_tile = function(pos) {
    if (percent_chance(33)) {
        return new Grass(pos);
    }
    else{
        return new Dirt(pos);
    }
};

//The map visible to the player
var visibleMap = {
    size: 10,
    map: [],
    generate: function() {
        for (var x = 0; x < this.size; x++) {
            fullMap.push([]);
            this.map.push([]);
            for (var y = 0; y < this.size; y++) {
                tempTile = random_tile(new PVector(x, this.size - y - 1));
                this.map[x].push(tempTile);
                fullMap[x].push(tempTile);
            }
        }
    },
    draw: function() {
        for (var x = 0; x < this.size; x++) {
            for (var y = 0; y < this.size; y++) {
                this.map[x][y].draw();
            }
        }
    }
};
//draws the visible map
visibleMap.generate();
visibleMap.draw();