Hey everyone! Let's share one tip that we learned recently, whether its about javascript, html, css, react, etc. So beginners and even pros can lea...
For further actions, you may consider blocking this person and/or reporting abuse
Adaptive loading is one thing I learned that really stands out
Adaptive Loading - Improving Web Performance on low-end devices
Addy Osmani ・ Nov 18 '19 ・ 3 min read
For whatever reason when I read that post it really blew my mind.
Awesome. Thanks for sharing Ben!
Oooh, I know a good one!
copy()
on Chrome DevTools (other browsers probably) adds to your clipboard anything you use as an argument.That gets really powerful when you use it with "Store as global variable". That way you can log a huge server response, for instance, and copy it from the Dev Tools console.
Here's an example:
I use this all the time when I want to quickly do some web scraping on-the-fly. A little bit of
Array#map
chaining can easily automate what would have been millionCtrl + C
s.nice one! i'll remember this one :)
Thanks for sharing
This is so cool
I recently found an article describing online/offline detection. It's as easy as:
window.addEventListener('online', () => console.log('online'))
Works for 'offline' events too. You could also check for 'navigator.onLine'
Oh nice. I believe Dev uses a version of that to disolay th3 doodle wheb youre offline ;)
Yeah from here
🚀 Detecting If a User is Online/Offline with JavaScript
Niall Maher ・ Jun 25 ・ 4 min read
Nice
Don't exhaust yourself. Take it easy and stay focused
The one thing I want to share here is that it is not related to web development but jobs and works that is related to any kind of development job.
It does not matter how good a learner, strong committer, hard worker, and effective value adder, the company or organization that you are applying or working will appreciate skills that are only required by that organization.
The thing is that how many courses you have completed or how good grades you have achieved in the studies, the organizations and the recruiters will be looking for someone who has the experience of 3-5 years and someone perfect so that they can get high results in a small amount of time.
There are a few companies and organizations that are aiming to train individuals so that they can become good and professional individuals, and also they are not looking forward to creating a strong and beneficial asset for their organization as well.
i totally agree with this. Thanks for sharing!
your welcome
you can clone an array in javascript with [...Array] thank you for mr awais for this i dont know his dev.to username but wherever you are thanks
Can you show an example of how you would do that in javascript?
Thanks for sharing!
really? that was super simple bro
as simple as that
Sweet. Definitely useful! Thanks
i found it here the original post
You can do the same with objects. Keep in mind, this doesn't deep clone. So if you intend to change the values in any way, you'll still be mutating the pointer, and by consequence, the original object.
I learned that it is always important to use label, title, aria-label or aria-labelledby along with input fields in forms, in order to be accessible by screen readers and assistive technologies.
Very true its becoming increasingly important to add those!
Pointers aren't always a good idea!
This was learnt from my own mistake. Don't use flexbox for everything. If you do, there's performance and code clarity considerations. Think about whether
position: absolute
can solve the problem just as well.When would you prefer position: absolute over flexbox? For centering/aligning I almost allways use flexbox, also over text-align: center. Absolute positioning I use for pseudo elements or floating alerts for example.
My logic is, if something can be done with
position: absolute
, do it with it. Otherwise, flexbox is ok. Withposition: absolute
you have a lot of freedom: you can center, you can put the element almost anywhere you want and make it behave like you want based on screen size. I think absolute position is often underused. Flexbox, although flexible, might get a bit complicated and will likely reduce your performance. I created a WYSIWYG editor once, whose ancestors were all flexbox. Remember, flexbox has to relayout and repaint if any of its content changed. So, because of that, if you had a lot of content, editing it was unbearably slow and laggy after typing every character.With
position: absolute
you can center as well, although not as cleanly, but you can get used to it:Mistakes sometimes turn out to be gold !
Nice and thanks for sharing :)