5 webdev tips you may want to know 🔥

1. CSS sibling selector

You can use the adjacent sibling combinator (+) to target a sibling that comes directly after the first target. Or you can use the general sibling combinator (~) to target any sibling that comes after the first target…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Mustapha Aouas

1. CSS sibling selector

You can use the adjacent sibling combinator (+) to target a sibling that comes directly after the first target. Or you can use the general sibling combinator (~) to target any sibling that comes after the first target

CSS sibling selector

 

2. The capture attribute

You can open a device camera directly from the HTML using the “capture” attribute 🔥
Set it to “user” if you want the selfie cam 🤳 or to “environment” if you want the rear cam 📸

The capture attribute

 

3. Know how many fingers are touching the screen

Did you know that you can know how many fingers are touching the screen in javascript like this 👇

Know how many fingers are touching the screen

 

Hey there 👋 I tweet daily about the things I learned in my 6+ years journey in web development, so if you like these tips consider following me on Twitter @theAngularGuy. 🙂

 

4. Triple equality special cases

In javascript triple equality (===) is usually enough for equality comparisons. But it has two special cases: NaN and -0 +0.
Hopefully Object.is() does not 💡

Triple equality special cases

 

5. Tuple in typescript

The difference between these two function is the type of the first one will be inferred as number[] while the type of the second will be a tuple of [number, number] (actually readonly [number, number])

Tuple in typescript

 
 

Let's connect

That's it for this week. I hope you liked it. If you did, please share it with your friends & colleagues and follow me on Twitter @theAngularGuy where I tweet about web development and computer science 🚀

Cheers!

What to read next?


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Mustapha Aouas


Print Share Comment Cite Upload Translate Updates
APA

Mustapha Aouas | Sciencx (2022-09-16T16:15:03+00:00) 5 webdev tips you may want to know 🔥. Retrieved from https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/

MLA
" » 5 webdev tips you may want to know 🔥." Mustapha Aouas | Sciencx - Friday September 16, 2022, https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/
HARVARD
Mustapha Aouas | Sciencx Friday September 16, 2022 » 5 webdev tips you may want to know 🔥., viewed ,<https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/>
VANCOUVER
Mustapha Aouas | Sciencx - » 5 webdev tips you may want to know 🔥. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/
CHICAGO
" » 5 webdev tips you may want to know 🔥." Mustapha Aouas | Sciencx - Accessed . https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/
IEEE
" » 5 webdev tips you may want to know 🔥." Mustapha Aouas | Sciencx [Online]. Available: https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/. [Accessed: ]
rf:citation
» 5 webdev tips you may want to know 🔥 | Mustapha Aouas | Sciencx | https://www.scien.cx/2022/09/16/5-webdev-tips-you-may-want-to-know-%f0%9f%94%a5/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.