Built-ins & The Standard Library
#PythonForJSDevs #javascript #js #python #tekkengreg
Built-ins & The Standard Library
#PythonForJSDevs #javascript #js #python #tekkengreg
switch (true) {
case score > 90:
// ...
}
Great way to clean up messy if/else blocks.
Looks odd, but super readable once you get used to it 😎
#JavaScript #DevTips
switch (true) {
case score > 90:
// ...
}
Great way to clean up messy if/else blocks.
Looks odd, but super readable once you get used to it 😎
#JavaScript #DevTips
if (user && user.address && user.address.city) { // ... }
Had a little 2015 flashback 😅
You can just write:
user?.address?.city
So much cleaner.
Use it.
code today:
if (user && user.address && user.address.city) { // ... }
Had a little 2015 flashback 😅
You can just write:
user?.address?.city
So much cleaner.
Use it.
#JavaScript #TypeScript #DevLife
if (user && user.address && user.address.city) { // ... }
Had a little 2015 flashback 😅
You can just write:
user?.address?.city
So much cleaner.
Use it.
code today:
if (user && user.address && user.address.city) { // ... }
Had a little 2015 flashback 😅
You can just write:
user?.address?.city
So much cleaner.
Use it.
#JavaScript #TypeScript #DevLife
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
d out you can do this in JS:
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
d out you can do this in JS:
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
#JavaScript #TypeScript #DevLife
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
d out you can do this in JS:
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
d out you can do this in JS:
const last = arr.at(-1);
Way cleaner than arr[arr.length - 1] 😮💨
Also works for arr.at(-2) etc.
Not new, but somehow I missed it.
Sharing in case you did too 🤷♂️
#JavaScript #TypeScript #DevLife
Virtual Environments & Dependency Management
#PythonForJSDevs #javascript #js #python #tekkengreg
Virtual Environments & Dependency Management
#PythonForJSDevs #javascript #js #python #tekkengreg