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
Β
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.
Β
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:
Β
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:
Β
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]
)
Β
Β
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!
Top comments (2)
Nice read, but way too much emoji.
Yes. Needs much more cowbell.