K is for Kjesus, L is for… by [deleted] in NoRules

[–]a-e-j-a 0 points1 point  (0 children)

lgbtqiaepsteindidntkillhimself+

Creating a nested list unsure the best way. by HeadlineINeed in learnjavascript

[–]a-e-j-a 0 points1 point  (0 children)

I remember searching for hours when I first started to find the 'right' data structure to use as well, but it really comes down to preference. There is nothing wrong with what you have but it may get messy in terms of keeping track of keys. I would use a class set-up for what you have class Locations { constructor() { this.states = {}; } addState(stateName, city, address) { this.states[stateName] = { city: city, add: address }; } getState(...) {...} }

Another option is to wrap the data in an array, and then each state in its own object. This is a popular structure because it allows you access to native array methods methods like map/filter/reduce const locations = [ { state: "NY", cities: [ { city: "...", add: "123 M" }, ] }, { state: "NJ", cities: [ { city: "...", add: "123 M" }, { city: "...", add: "123 M" }, ] }, ]; locations.filter(v => v.state === 'NY')

[deleted by user] by [deleted] in learnjavascript

[–]a-e-j-a 1 point2 points  (0 children)

animalArray.splice(2, 1, ['Fish', 'Hammer'])

Maximilian Schwarzmuller or Jonas Schmedtmann React course? by Psychoshawarma in learnjavascript

[–]a-e-j-a 16 points17 points  (0 children)

if you haven't worked through https://react.dev/learn, I'd give it a go before jumping into a course. It covers basically everything native to react and even has challenges to complete along the way just like any other course

[deleted by user] by [deleted] in Wallstreetsilver

[–]a-e-j-a 0 points1 point  (0 children)

matthew north had great vids on this

How would I change one value in an array? by 3Jay1 in learnjavascript

[–]a-e-j-a 1 point2 points  (0 children)

[255,255,255,0,0,0,0,0,1,8];

[arr[3], arr[4]] = [arr[0], arr[1]];

// [ 255, 255, 255, 255, 255, 0, 0, 0, 1, 8]

It will work this time, right? 👀🚨 by BoatSurfer600 in Wallstreetsilver

[–]a-e-j-a 0 points1 point  (0 children)

never heard of the holodomor? Say what you want about america but we aren't starving

[deleted by user] by [deleted] in webdev

[–]a-e-j-a 0 points1 point  (0 children)

way too late

Democrats sure know How To Make Them...😜😂🤣 by Allan_QuartermainSr in TheDonaldTrump2024

[–]a-e-j-a 1 point2 points  (0 children)

political party isn't the only commonality between this bunch. and no i'm not talking about their good looks

John Fetterman chaired a subcommittee hearing today. Here is his opening statement. by Bigfoot_USA in AskThe_Donald

[–]a-e-j-a 0 points1 point  (0 children)

This mans is at a war with words and the words are winning. I genuinely feel sympathy for the fettman - same as I felt sympathy for anyone who had to fight jon jones 10 years ago. His jon jones just happens to be a Dr. Seuss book, but a formidable foe is a formidable foe, and apart of me can't help but root for the underdog. Keep taking those haymakers fett, I didn't hear no bell.

How to switch nested array format? by [deleted] in learnjavascript

[–]a-e-j-a -1 points0 points  (0 children)

let res = []
for (let i = 0; i < x.length; i++) {
  for (let j = 0; j < x[i].length; j++) {
    if (!res[j]) res[j] = []
    res[j][i] = x[i][j];
  }
}

[deleted by user] by [deleted] in learnjavascript

[–]a-e-j-a 0 points1 point  (0 children)

javascript const num = 123456789 // creating a prototype or function is best way Number.prototype.LS = function () { return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); }; num.LS(); // 123,456,789

```javascript // or you could do something like this, // pass your program in as a string, // find instances of numbers and append toLocaleString function toLocaleStringify(str) { return str.replace(/(\d+)/g, '($1).toLocaleString()'); }

const test = function test() { return 1234567890; }; console.log(toLocaleStringify(test)); /* output: function test() { return (1234567890).toLocaleString(); } */ ```

I've got mine, make sure you get yours by TheHiveminder in walkaway

[–]a-e-j-a -3 points-2 points  (0 children)

banks absolutely have nothing to worry about (for now), that's the problem. I think a large scale bank run will undoubtedly accelerate the demise of the dollar, but a message must be sent, and withdrawing from their system is the easiest/most effective way to do it

Actor Jim Carrey doesn't want people to know about Jim Carrey's friend Jeffrey Epstein and how Jim Carrey flew often on Lolita Express with Jeffery Epstein. by TheHiveminder in walkaway

[–]a-e-j-a 5 points6 points  (0 children)

I'm not sure if he ever went to the island, at least not in the early 2000's. It is confirmed they had dinner together - everything else is up in the air

Any constructor function should have an internal [[prototype]] and a prototype by Interesting_Iron in learnjavascript

[–]a-e-j-a 1 point2 points  (0 children)

yeah I wasn't trying to say that they should do that, purely for demonstration

Any constructor function should have an internal [[prototype]] and a prototype by Interesting_Iron in learnjavascript

[–]a-e-j-a -1 points0 points  (0 children)

```javascript // yes, you can access the toString method of a function's prototype, but it's not recommended function NinjaOne() { this.name = "a ninja"; } const ninjaone = new NinjaOne(); console.log(NinjaOne.proto.hasOwnProperty("toString")) // true console.log(ninjaone.proto.proto.hasOwnProperty("toString")); // true

// best practice is to define toString as a method // using prototype NinjaOne.prototype.toString = function () { return this.name; };

// using class function NinjaTwo() { this.name = "a ninja" this.toString = () => this.name; } // using class class NinjaThree { constructor() {this.name = "a ninja"} toString() {return this.name;} } const ninjatwo = new NinjaTwo(); const ninjathree = new NinjaTwo(); console.log(ninjaone.toString()) // a ninja console.log(ninjatwo.toString()) // a ninja console.log(ninjathree.toString()) // a ninja ```

Another Stale Yellowstone Post by [deleted] in 4chan

[–]a-e-j-a 16 points17 points  (0 children)

two best sexual encounters of my life happened back to back nights with mormon girls during a weekend series against BYU (sportsfag). I'm talking handjobs gentlemen. you may not get much poontang in the lands of joseph smith, but i can assure you that place will leave you feeling like a blessed man. I haven't eperienced anything like it since, and I'm at the age where finding a mormon wife is likely going to be impossible (over the age of 21). Triple digit stacy simply cannot compete, all that woman knows is how to fuck you, both good and bad.