Stephen retweeted
🔥 JavaScript's new .at() method lets you pick items based on their index.
This is super handy for grabbing the last item of an array or string because, unlike arrays, it supports negative indexes!
![// 🔥 New .at() method on arrays and strings const toppings = ['pepperoni', 'cheese', 'mushrooms']; // The old way to grab the last item toppings[toppings.length - 1]; // mushrooms // using .at() method with a negative index toppings.at(-1); // mushrooms // works with any index toppings.at(0); // pepperoni toppings.at(-2); // cheese // and with strings! 'Meeting Room: B'.at(-1) // B](https://pbs.twimg.com/media/E-nFweJX0Ac67A4.jpg?name=small&format=webp)
ALT // 🔥 New .at() method on arrays and strings const toppings = ['pepperoni', 'cheese', 'mushrooms']; // The old way to grab the last item toppings[toppings.length - 1]; // mushrooms // using .at() method with a negative index toppings.at(-1); // mushrooms // works with any index toppings.at(0); // pepperoni toppings.at(-2); // cheese // and with strings! 'Meeting Room: B'.at(-1) // B
Stephen retweeted
Startup idea: We bundle all the streaming services together, sell a set top box that makes it easy, with a single monthly bill. We could have different “channels” and wrap everything in a package with a “cable.” Just spitballing here.
We are in Streaming Hell. Everything is $7.99 a month and every streaming service has exactly one show you want.
Stephen retweeted
Replying to @wesbos @StephenIsCoding
It's just using square bracket notation to look up the method instead of dot notation. This way you can run a statement/use variables
Stephen retweeted
How to code with a newborn
- Buy a standing desk
- Learn how to use a baby wrap
- Play ambient music
- Dance
Stephen retweeted
Ending #NetNeutrality doesn’t serve the public interest or benefit American consumers – it will only benefit the handful of giant companies that will block, filter, or charge more for what we do online.
Stephen retweeted
For all of those who rely on the free an open internet – whether it’s for commerce, education, healthcare, or entertainment – I urge you to join me in creating a firestorm of opposition to this assault on #NetNeutrality








