Category: Javascript

Understanding ‘prototypes’ and ‘class’

I mean, it isn’t necessarily good practice to extend the prototype of of something like objects anyways, so there wouldn’t be a reason to worry about Object.assign most of the time, I would think. In the case of messing with prototype, you’d be more apt to write your own classes and extend with the `extends` …


Your /r/javascript recap for the week of July 27 – August 02

Monday, July 27 – Sunday, August 02 Top Posts   Most Commented Posts   Top Ask JS score comments title & link 19 12 comments [AskJS] [AskJS] Why isn’t Apple part of the Ordinary members of TC39? 9 2 comments [Removed: [AskJS] Abuse] [AskJS] Coronavirus Dashboard fully visualised in D3.JS 6 5 comments [AskJS] [AskJS] …


How I Build Scalable Modern Web Applications for Real Users

CSS Library — None I really wanted to have full control over the user experience and design, so I decided to code the entire UI from scratch. This allows me to optimize for the value that I’m trying to deliver. All my components are being built by hand with the exception of some lower-level libraries …


Simplify your JavaScript – Use .map(), .reduce(), and .filter()

This is not best practices, but it certainly does work to globally monkey-patch the more useful Array# functions into NodeLists. (({ prototype: l }, { prototype: c }, { prototype: { forEach, map, find, filter, reduce, slice } }) => [l, c].forEach(p => !p.map && Object.assign(p, { forEach, map, find, filter, reduce, slice }) ) …


Different versions of your site can be running at the same time

It’s pretty easy for a user to be running an old version of your site. Not only that, but a user could be running many different versions of your site at the same time, in different tabs, and that’s kinda terrifying. For instance: A user opens your site. You deploy an update. The user opens …


Gamedev Patterns and Algorithms with TypeScript. Game Loop 2/2

Thanks for taking the time to produce part 1 & 2. Looking forward to the rest (saved your page.) I hope it goes without saying, you do a great job with the final product (code + walk through.) More linguistic / semantic question, wouldn’t this be more a “simulated (linear?) time loop”? I’m aware the …


How to import CSS in React.js component?

This article was originally published at https://www.blog.duomly.com/6-most-popular-front-end-interview-questions-and-answers-for-beginners-part-2/#how-to-import-css-in-react-js-component Now I’ll show you how to import CSS in react.js components, by the two most easy, and kinda popular ways. When we build apps in React.js in some cases, we can use CSS-frameworks like bootstrap, Bulma, or something popular now. Next, we can build a layout like puzzles …


I’ve created a React hook to grab a color palette from images. It also renders a skeleton color while your original image still loading. Feedback appreciated

Yeah — it’d be interesting to build this as part of a build pipeline. Do the analysis during the build, store a configuration file with a list of identifier (probably the image URL) and and output pairs to serve as config for the skeleton. Then the front end script can load that config and do …


CSS Logical Properties

Create spacing that works regardless of the direction of your content or the environment of your users. Say you want to put some space between two inline items: what do you do? Probably something like this: .my-element { margin-left: 1em; } This approach is fine and has been for a long time with CSS, but …


WebStorm 2020.2: Use Prettier as the Default Formatter, Work with Nuxt.js, and Get Full Support for GitHub PRs

I really want to love Webstorm but there are alot of things that vscode just does it for a beginner like me. I felt that even though it’s a bit slow sometimes auto completion/IntelliSense in vscode is way better and made me far more productive than I was on Webstorm.(ex: li / style tag in …