Does it look like a duck and quack like a duck?

Typescript uses duck typing, since the underlying JavaScript is not supporting object orientation by classes but prototypes (A re-introduction to JavaScript). What this means from a practical sense is if you define two classes in Typescript with the same properties, function signatures, the classes will be interchangeable.

I’ve made a small research project. Basically i wanted to measure clean code. 100 high school graduates answer a ‘what is the output of the code’ kind of questions. Whenever we say code cleanness, we can’t measure. There are of course code smells, but no exact definition. That’s why its…

Well, you were wrong. It turns out Webcomponents leak. We’re using polymer engine, and here’s what our code looked like on the parent page:

<meta name=”viewport” content=”width=device-width, …, viewport-fit=cover”>

and in the webcomponent:

<meta name=”viewport” content=”width=device-width, …”>

It turns out, as soon as you load the webcomponent, its meta will override the parent page’s meta, as they share name, therefore breaking iOS notch functionality, and adding two ugly bars for the not safe space.

look, how ugly the two white bar on the edge of the screen is. the viewport-fit will sort that — unless you override it from webcomponents

Altough I’ve been using the rest properties for a while in react like

propsStore = {
...propsStore,
changedProp: newValue
};

there are a lot more to them!

Alongside with Promise.prototype.finally Faraz Kelhini wrote a very decent collection on them, be sure to read it:

https://css-tricks.com/new-es2018-features-every-javascript-developer-should-know/

fetch('https://www.google.com')
.then((response) => {
console.log(response.status);
})
.catch((error) => {
console.log(error);
})
.finally(() => {
document.querySelector('#spinner').style.display = 'none';
});

Gabor Csomak

Tech Lead

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store