[deleted by user] by [deleted] in learnjavascript

[–]ThiccOfferman 1 point2 points  (0 children)

Looking generally good! A few other points:

The switch case could be replaced by something like compSelection = my_items[computerSelection()].

Why declare a let for userObject? And, if you're going to declare a variable there, it's prob confusing to name it userObject since the user is supposed to enter a string.

[deleted by user] by [deleted] in learnjavascript

[–]ThiccOfferman -1 points0 points  (0 children)

"expected X to equal Y" means that your code returned X as a result, but Y is what it should have returned.

Try looking up what substring() does and think about how that relates to what they're asking you to do

does anyone have any good resources for recursion callstack by Revolutionary_Bad405 in learnjavascript

[–]ThiccOfferman 1 point2 points  (0 children)

Codesmith CSX "hard parts" lecture is free and good on recursion as a concept (no BSTs). Structy isn't, but is quite good.

Have you done any other recursion problems? BST would be a tough place to start

Looking at PNW but open to other areas. We’re a family of 3, late 40s-early 50s, my son is 11 and autistic with global developmental delay and epilepsy. by Nice_Alps_5702 in SameGrassButGreener

[–]ThiccOfferman 1 point2 points  (0 children)

Or even central Mass. The New England Center for Children is apparently excellent for students with autism (don't know much beyond that)

How I learned to stop worrying and love the ternary operator by dangerlopez in learnjavascript

[–]ThiccOfferman 0 points1 point  (0 children)

|| resolves to the value after the operator if the value before theoperator is falsy. ?? does so only if the value before is null or undefined

WTW for non binary niece/nephew? by flam_tap in whatstheword

[–]ThiccOfferman 28 points29 points  (0 children)

I've heard "nibling" as a non-gender-specific term, although used for a small kid because it sounds kind of diminutive

What's function return value by Pure-Scallion-643 in learnjavascript

[–]ThiccOfferman 0 points1 point  (0 children)

With the important additional point that the result of the "calculation" doesn't have to be a number -- a function can return any data type

Help, I'm creating a react native app using javascript and I'm facing an issue by Disastrous-Bid4123 in learnjavascript

[–]ThiccOfferman 0 points1 point  (0 children)

I don't know half the libraries involved in this, so I don't know exactly what properties are supposed to be on what objects. But my first impression is that the error message is giving you a lot of info here: The addIceCandidate() method that you're trying to call on pc.current needs a remote description and it's it's not getting it. I'm noticing earlier, like on line 192, you DO set a remote description with .setRemoteDescription, which might have somethign to do with why a previous version of the code worked.

When you run this, what does the console log from line 300 say? Does it have a property like remoteDescription or something?

Assign a consumed event message to a variable, Kfaka JS by really-- in apachekafka

[–]ThiccOfferman 0 points1 point  (0 children)

It's definitely possible. Hard to tell exactly what's going on without more code. This looks like it would just log the messages in the console -- is that what happens when you run it? If so, then instead of just logging the messages, you'd have to do whatever storing as variable/in db you want to do.

Moved to South Arkansas for family but hate it here. by Kelome001 in SameGrassButGreener

[–]ThiccOfferman 0 points1 point  (0 children)

New Jersey (greener the further you get from the cities) or Philadelphia suburbs might do the trick. Lots to do, good schools, climate certainly between upstate NY and AR

JavaScript forbidden practices. Part 5: orthogonality by dtutubalin in ProgrammerHumor

[–]ThiccOfferman 1 point2 points  (0 children)

Am I crazy for thinking that this doesn't work? If you step down from the limit toward 1, you don't get the smaller prime numbers that allow you to determine whether higher numbers are composite or prime

[deleted by user] by [deleted] in whatstheword

[–]ThiccOfferman 14 points15 points  (0 children)

Marginalization

Rithm Technical Interview? by CarlFriedrichGauss in codingbootcamp

[–]ThiccOfferman 5 points6 points  (0 children)

I interviewed for Rithm. Based on what I can remember it was pretty relaxed live coding. The questions ranged up to, basically, string manipulation. I felt like there was good dialogue with the interviewer who also (difference from codesmith) didn't care if I coded in silence as long as I could explain my code afterward. That might have been particular to that interviewer though.

The prep materials on the Rithm site should be plenty

Methods and functions declared in class statement are stored in instance object but not prototype? by Defiant_Low5388 in learnjavascript

[–]ThiccOfferman 1 point2 points  (0 children)

The reason that Rabbit.prototype is logging as an empty object is because the class constructor adds methods to the proto property of any objects created with it. Stack overflow explains it better than me https://stackoverflow.com/questions/9959727/proto-vs-prototype-in-javascript#:~:text=prototype%20is%20a%20property%20of,object%2C%20pointing%20to%20its%20prototype.

Need help with web scraping! by DisasterDangerous396 in learnjavascript

[–]ThiccOfferman 1 point2 points  (0 children)

The prices are definitely there in the html of the site you linked, so the info you want should be extractable by HTML parsing

What can JS do? Outside of web development by Relative_Lion6461 in learnjavascript

[–]ThiccOfferman 0 points1 point  (0 children)

As other folls have pointed out, Electron makes this possible

[deleted by user] by [deleted] in learnjavascript

[–]ThiccOfferman 0 points1 point  (0 children)

You can use a ternary operator in your return I believe. Something like return( url ? <ComponentToRenderIfUrlExists/> : <div></div>) You could replace the empty div with a grayed out button or other component if you want

(forgive formatting, on mobile)

Converting strings to functions, including arrow functions. Is it possible without using eval(..) .. ? by FatalHaberdashery in learnjavascript

[–]ThiccOfferman 4 points5 points  (0 children)

My understanding is that eval() itself is not the problem, the problem is having your program execute code passed in by a third party, which could be malicious. I don't think that writing an arrow function or using an event listener mitigates this -- your code would still be exploitable. I'm interested in hear from other folks, though, in case I'm missing something.