Books

Sunday, March 14, 2021

I'm on a roll! 😅

Just this Tuesday, 9th of March, at work, I was partly responsible for a partial downtime of a critical piece of the internet's infrastructure. 

This morning, I got two packages delivered to my place. One for myself, the other, to keep for my neighbor who wasn't at home. A combination of miscommunication with the delivery guy and excitement to unwrap my package, I ended up tearing up my neighbors package, mistaking it for mine! 😅. It was super awkward explaining my little mistake to her, when she came to pick her stuff up 😬. 

And fast forward to just a couple of hours ago, I mistakenly pushed a property file containing sensitive credentials to Github! Impact not super devastating but still, some damage control had to be done! 

It feels like I am on a roll here...what will I be tripping over next? What will the next gaffe be? Me dropping the database in production? 😅😬

Update: Two months after, no database was harmed :)

Saturday, March 06, 2021

Spread and Rest in JavaScript

What does the rest parameter syntax look like? 

Simple, It looks like this: ...stuff

That’s cool. What about the spread syntax? What does that look like?

Well, it also looks like this: ...stuff

And this is why the spread and the rest parameter syntax could be confusing and easily misplaced for each other. They have precisely the same syntax! What then separates them? Answer is the context they are used.

This post will look into these JavaScript syntaxes with the aim of disambiguating them. The hope is that it helps in removing the confusion.