(HTMLthomas)

izzy's playlists!

Origami Around
Sade Olutola

oozey mess
No title available

PR's Tumblrdome
official daine visual archive

⁂
Keni
Xuebing Du

Love Begins
Three Goblin Art
Today's Document
One Nice Bug Per Day
Noah Kahan

titsay
untitled
Cosmic Funnies

Kaledo Art
Misplaced Lens Cap
seen from United States
seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States

seen from United States
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States
seen from Indonesia
seen from Brazil
seen from United States

seen from Sweden

seen from Saudi Arabia

seen from Türkiye
seen from Türkiye
@badalgorithm
(HTMLthomas)
(HTMLthomas)
(HTMLthomas) Give my boy a follow
Destructuring Assignments in JavaScript
A destructuring assignment allows mapping data structures directly to objects. For example, if I wanted to return the sum of values and number of keys of an object from a single function:
function sumAndLength(obj) { let sum = 0; for (let keyName in obj) { sum += obj[keyName]; } return [sum, Object.keys(obj).length]; } const obj = { property1: 150, property2: 200, property3: 175, }; let [sum, length] = sumAndLength(obj); console.log(sum, length); // 525, 3
This is very useful for simple functions where it is more convenient to return multiple results, but destructuring really becomes useful with object returns. Here is an example request that sends back (very simple) HTTP request data:
function simulateRequest(callback) { setTimeout(function() { callback({ statusCode: 200, body: { content: 'Request succeeded' } }); }, 500); }; simulateRequest(function(response) { const { statusCode: code, body: { content: bodyContent } } = response; console.info(code, bodyContent); // 200 'Request succeeded' });
This looks strange at first, but is easier to read than 2 separate extracting statements for the 2 variables once you get used to it. Unlike the older seperate extractions, the important parts of the structure of the return object is apparent with just reading the extraction code. The original function or documentation do not need to be viewed.
I covered what I think are the most useful parts of destructuring that I personally used, but there are a few more edge cases you may want to know about. MDN gives a good list of them. Destructors are available in every browser except IE (but are available for MS edge).
Github Location: https://github.com/Jacob-Friesen/obscurejs/blob/master/2017/destructuringAssignment.js
Finding the Best Free Fonts for Numbers
Including a Recommendation List for 20 Google Fonts
Samantha Zhang:
Though there are countless blog posts and recommendation lists for fonts and font pairings these days, when you look for best fonts for numbers, it’s not as easy to find. If you can’t afford FF DIN or Numbers by H&CO, there isn’t much guidance, let alone a go-to recommendation list.
The thing about programming is experience doesn’t mean you don’t create bugs, you just learn to recognise them faster.
(via thethingaboutprogramming)
So true
When you’ve been trying to work out an error all day and it was right in front of you the whole day.
This is what made this blog what it is
Things Programmers Shout #604
“Illegal declaration? You’re an illegal declaration!” // submitted by @pennylaneforthoughts
Things Programmers Shout #607
“YOU WEREN’T WORKING BEFORE HOW DID YOU JUST START WORKING?” // submitted by @sillyhappyperson
Things Programmers Shout #608
“THIS IS THE COMPILER MESSING UP NOT ME WHY!” // submitted by @tylermccarthy
Things Programmers Shout #611
To another programmer: “You did exactly what I told you to do, good job. I’m an idiot.”
// submitted by @star-of-the-anime
Things Programmers Comment #82
// if something has gone horribly wrong return this ( submitted by @mynameisuntold)
Things Programmers Shotu #612
“Why isnt my code working?!” *5 minutes later* “Why is my code working?!”
// submitted by @felix-jones
Things Programmers Shout #616
“OH MY FREAKING GOD WHY DOES ADDING QUOTATION MARKS TO SOMETHING I AM SUPPOSED TO ADD THEM TO BREAK MY CODE WHY WHY WHY!” // submitted by anonymous
Things Programmers Shout #618
“That didn’t work at all.”
Things Programmers Shout #619
“Annnd… you froze.”
Trip Guide App - Light Nur Praditya Wibisono