Monthly Digest January 2018
- Published at
- Updated at
- Reading time
- 4min
Hello everybody! ππ»
You might remember my "This month I learned" series in which I shared articles that I posted in... surprise... my "Today I learned" section. I decided to change the format a little bit, also include other great things that I read or discovered and to make it available via a newsletter.
So here we go!
bit.ly/randommdn is my new daily routine. How can a URL be a routine? Well... this URL redirects to a random article on MDN. A slack bot reminds me every day to open it and read it while having my morning coffee. I highly recommend that because there is always good content to discover. MDN is such a good resource!
Speaking of routines β I'm keeping track of great quotes that could go into a talk for a year now and usually kept them in Inbox. I now moved these quotes onto my site. Maybe these are useful for someone in the upcoming conference season.
How the rest operator and default values affect the function length property
You may know that you can access the number of arguments a JavaScript function expects using the length
property. I learned that the rest operator and default values have an interesting effect on it.
function myFunc1 (a) { } // myFunc1.length === 1
function myFunc2 (a, ...) { } // myFunc2.length === ?
function myFunc3 (a, b, c, ...) { } // myFunc3.length === ?
function myFunc4 (...a) { } // myFunc4.length === ?
function myFunc5 (a = 1, b = 2) { } // myFunc5.length === ?
function myFunc6 (a = 1, b) { } // myFunc6.length === ?
function myFunc7 (a, b = 2) { } // myFunc7.length === ?
The for accessibility required caption
element in HTML tables
I discovered that I coded tables for years that are not following accessibility standards completely. It turns out that a fully accessible table should include a caption element. I have no idea how I couldn't know about that!
<table>
<caption>Food to buy</caption>
<tr>...</tr>
</table>
How to write reusable sane API-based Preact, React or Vue.js components using the Render Props pattern
I learned about the "Render props" pattern in React which is extremely handy when dealing with APIs. So far I haven't found a way to write reusable components that fetch data from an API β but using "Render props" fetching data from an API becomes fun. I wrote about this pattern and checked if it works also in frameworks other than React (e.g. Vue.js).
<ApiWrapper query={{ content_type: 'tilPost', limit: 5 }}>
{({ items }) => (
<ul>
{ items.map(item => <li>{item.fields.title}</li>) }
</ul>
)}
</ApiWrapper>
John David-Dalton took the time and jumped on a call with me to explain how I can use the fairly new import
EcmaScript modules syntax with @std/esm in Node.js today.
There was one article this month that really amazed me. The article "Iβm harvesting credit card numbers and passwords from your site. Hereβs how." by David Gilbertson not only shows that we all are not taking care of our code dependencies enough but also explains "great" tricks on how to make an attack invisible. Excellent read!
Henrik Joreteg gave the fantastic keynote "Betting on the web" which covers the topic PWA. This topic was so present over the last year that it's hard to get me excited about it in a talk, but this talk is excellent in so many ways and includes one of my new favorite quotes, too!
You're shaping tomorrow's job market based on the technology choices you make today.
The wonderful voice and piano sounds of Jose Wanders in "Blue notes" made me stop coding and listen instead.
And we can listen to records with the lights off and you can draw letters on my hand.
I love this line! β€οΈ
I hope you enjoyed this first monthly digest and if you have any feedback let me know. Have a great February! ππ»
Join 5.3k readers and learn something new every week with Web Weekly.