Tag: code

Looping through objects in JavaScript
Post

Looping through objects in JavaScript

Once in a while, you may need to loop through Objects in JavaScript. The only way to do so before ES6 is with a for...in loop. The problem with a for...in loop is that it iterates through properties in the Prototype chain. When you loop through an object with the for...inloop, you need to check if the property belongs to...

Another engineer asked me for feedback…
Post

Another engineer asked me for feedback…

Another engineer asked me for feedback on their performance. I wrote a few things down and then re-read it and realized this could apply to almost anyone. What follows is the advice I gave them. Names and technologies have been changed for their own protection… What am I doing wrong? I tend to think positively, which...

How To Review Code You Don’t Understand
Post

How To Review Code You Don’t Understand

I recently read an article by Max Bittker called “How to Review Code You Don’t Understand”, and it got me to thinking about times when I’ve been tasked with doing just that. One of the troubles I have with code review is understanding the context around a change. Given a diff, I can work through it...

React v16.4.0: Pointer Events
Post

React v16.4.0: Pointer Events

The latest minor release adds support for an oft-requested feature: pointer events! It also includes a bugfix for getDerivedStateFromProps. Check out the full changelog below. Pointer Events The following event types are now available in React DOM: onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture onLostPointerCapture onPointerEnter onPointerLeave onPointerOver onPointerOut Please note that these events will only work in browsers that...

The syntactical Sugar Classes of JavaScript
Post

The syntactical Sugar Classes of JavaScript

In my previous article; Getters And Setters used in JavaScript Objects….How? Ogwuru Johnson #javascript#tutorial#programming we looked at Getters and Setters as they apply to objects in JavaScript and i recall promising to show us how we could use getters in Es6 classes, We would also learn a great deal about classes. First of; i wouldn’t...

Good Practices – Code Review Comments
Post

Good Practices – Code Review Comments

If you do code review, you likely come across the same issues over and over again. People who are contributing to your code base for the first time may not know your team’s internal standards, they may come from a different language and do things slightly differently. A new hire may need to get up...

What the… error handling! (try…catch)
Post

What the… error handling! (try…catch)

Please check your code! Bugs exist… and they always will. No matter how good we are at code, or how focused is our mind while coding… there will be bugs like Coding bugs or Input bugs or whatever. we have a duty … to do our best to control them A very basic way to control our code, is something really smart and easy. Is there an error?...

Functional Programming with JavaScript ES6
Post

Functional Programming with JavaScript ES6

Functional programming is a style that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. Original post @ http://www.ajinkyaxjs.com/2018/05/02/functional-programming-es6-cheatsheet.html Arrow Functions (Fat Arrows) Arrow functions create a concise expression that encapsulates a small piece of functionality. Additionally, arrows retain the scope of the caller inside the function eliminating the need of...