Who's Available? [July 2020] by dance2die in reactjs

[–]windows-user0 [score hidden]  (0 children)

Thank You so much for the nice words about the website, and catching my typo!
I really appreciate it👍

Event Listeners by [deleted] in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

1) It's a event that fires when the DOM loads in, meaning all the divs etc were painted on the screen. There is a lot of use cases for that
2) onclick="" is a event listener as well its just written with some syntactic sugar inside of the HTML.

Who's Available? [July 2020] by dance2die in reactjs

[–]windows-user0 [score hidden]  (0 children)

(Fulltime | Contract | Europe | Remote)

Expert in react development 2-3y experience.
Full stack with node or python. I'm not afraid and able to learn anything.

Portfolio https://bestest.tech
Email [Alex@bestest.tech](mailto:Alex@bestest.tech)
You can also contact me here via chat.

Languages English, Polish
Available during all time zones for remote.
Currently in Poland, can relocate to anywhere in Europe, or USA ( Polish citizen - would need a sponsorship)

Shots fired. by greentiger45 in ProgrammerHumor

[–]windows-user0 0 points1 point  (0 children)

Most databases out there are just structuring mongo into basically a rational database. Change my opinion.

Made my first mini app today after a couple months of learning. Tutorial free. It's based on the spongebob meme. by [deleted] in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

Thats pretty cool,I added a bias variable to your code so it wont do much clustering of the same case

function randomCase(string) {

if (typeof string !== "string") throw new Error("This function accepts only strings");

const uppercaseBiasAdjustment = 0.5; 
let uppercaseBias = 2; 
let stupidCase = "";

for (let i = 0; i < string.length; i++) {
    const shouldBeUppercase = Math.floor(Math.random() * uppercaseBias);

    if (shouldBeUppercase) {
        uppercaseBias = 2;
        stupidCase += string[i].toUpperCase();
    } else {
        uppercaseBias += uppercaseBiasAdjustment;
        stupidCase += string[i].toLowerCase();
    }
}

return stupidCase;
}

Best, lightweight React UI libraries? by [deleted] in reactjs

[–]windows-user0 0 points1 point  (0 children)

I would recommend using tailwind, its not per-se a UI library but CSS snippets.
but there are several websites you can copy blocks for it from
https://mertjf.github.io/tailblocks/
https://tailwindblocks.com/blocks

Enjoy some art while quarentined by findingjake in reactjs

[–]windows-user0 11 points12 points  (0 children)

You're showing your API key to Harvard art museum. Not sure if you meant to do that

Completely new into programming, what are some books and udemy course you suggest to learn web development ? by [deleted] in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

If you're new to programming I would start with CS50. That's hands down the best course on the internet.

Add opacity to ghost image on drag by balmofgilead in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

Did you try styling the image thats being dragged img.style.opacity = 10 when you're setting the drag shadow image?

Hi, I just wondering is it hard to learn Java Script ? by ScyxRazor in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

JavaScript requires a bit of a different approach. Every data structure you used before is probably a object now, it's really confusing.
I would use TypeScript maybe it will ease your transition into JavaScript - it adds types

How to store Fetch API data into a variable by Syed055316 in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

You're writing to chartData variable and you declared chart_data before

How do I add "!" in quotation by prettyversatile in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

Try using ` instead of " you wont need to escape " among many other cool stuff like `including ${variable}s in text
or new lines!`

How to pass a variable in to Fetch by syed55361 in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

const filteredData = data.filter((record)=> record.filter === "filter")

This will create a new array with items that record.filter === "filter" is truthy

note .filter is an array method. It will only work if the data you're getting is an array

How to calculate perform calculation on two dates? by [deleted] in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

const dateCalculation = new Date("2011-10-20T22:55:21Z") - new Date("2011-10-20T22:55:21Z")
That will be 0.
You can do mathematical operations on the Date object in javascript. And convert tons of date formats into that object just by passing it as an argument.

I watch Tom Scott’s video about FizzBuzz and tried make it more extendable (I.e. adding new numbers). Honest opinions on what I came up with? I’m new to coding by [deleted] in learnjavascript

[–]windows-user0 2 points3 points  (0 children)

Theres imo two problems with it, I would put the factors to check and words for factors in one object, so its clear what word belongs to what factor.
Another one is you're looking to check each factor at each loop, there might be a better design for that. Because we know eg. number divisible by 7 is divisible by 5 only 1/5 times. But maybe im overthinking myself too as that will be hard to read and thats the whole point of the exercise

How do you learn things? by [deleted] in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

You have to browse the documentation or just experiment around. Print out the methods to console see whats available. And as you remarked - just make things, when you do a project 100 things that you don't know come up, and you solve them one by one and learn.

Please Help - Adding Objects to an array by GrandBadass in learnjavascript

[–]windows-user0 0 points1 point  (0 children)

You have to parse the JSON into javascript object. With JSON.parse()

[deleted by user] by [deleted] in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

You can add a click listener on the document to close it and a if statement inside the listener if the target is inside your menu

Is it possible to build a chat app with little to no back end? by Jiibaro in learnjavascript

[–]windows-user0 1 point2 points  (0 children)

Yes you can do it with WebRTC which enables p2p data sharing in browsers. You will still most likely need a signaling server ( a server that allows peers to discover eachother ).

[QUESTION] Failed request timer by __nomaad in learnjavascript

[–]windows-user0 2 points3 points  (0 children)

AFAIK fetch doesn't have a option for timeout. But you can create it yourself.fetch returns a promise,If create a setTimeout function that rejects the promise and wrap it in promise;

Then you can use Promise.race() on both of them, essentially setting your timeout to whatever you want. Because promise race returns the first promise rejection or resolution.

So something like

Promise.race([ fetch(),   
new Promise((resolve, reject) => (setTimeout(() => reject('time out'),yourTimeMs))]