@relentless-coder well the fastest way to do it logically would be to replace each item in the array with the highest item in the array, which is what I'm doing
@zifahm Or instead of directly calling the function in the render return, try setting the function output to constructor variables or state variables and then populating your HTML based off of said variables.
It would be faster if you used for loops probably since apparently they're faster than Array methods
@kbaig If I'm not mistaken, map and forEach are faster than for
I could be wrong though, I'm not an expert haha
@zifahm I'm sorry. I do think @ehutchllew is correct.
what to do
@zifahm okay so my suggestion is, if it's still not working, take a step back and just get something extremely basic to render like: <div><p> HI </p> </div> add some styling to it to make sure it's not empty, and then work up from there.
@zifahm I forget that often, so I saw it pretty quickly :)
Hi everyone, just discovered this chat here and don't know if this is the right place to ask... I'm working on the random quote machine and I'm stuck with my twitter button. I wanna use the .attr method to push the quote into the twitter 'data-text' field but can't figure out how to implement it. Could somebody maybe help me out there? This is my codepen (please ignore the design!) https://codepen.io/yogiwhocodes/pen/ZvOmyd
@yogiwhocodes - hello. Not sure about the twitter button just yet, but looking at the page. One suggestion - get a quote to populate your quote box or put some text in there to begin with - maybe a favorite quote? And something like "Click the button for new quotes"... ?
@yogiwhocodes - one problem is that there is no button or element with the id twitter-btn, at least it doesn't appear to be there? I think that after running that twitter code, it makes its own element on the page. Going to look at the docs to see how they recommend updating it.
@khaduch There is an <a> with that id, trying to debug too but no idea why it is acting this way.