How to loop through JavaScript Objects ?

The High Order Array Methods introduced in ES6 makes looping through JavaScript Array pretty easy. However, this is not the same for JavaScript Objects since those methods can only be used with Array.

This tutorial shows how to iterate through JavaScript objects using two basic techniques.

Using the loop statement

Before the advancement of ES6, the traditional way of looping through a JavaScript Objects is to use But the drawback with using is that we would need to check if the property belongs to the Object.

Nearly all web applications across the internet gives their users the ability to search through their contents for easy accessibility of resources.

In most cases, this is usually done by interacting and querying results from the database.

In this tutorial, we will implement a search functionality in Django website. Click this link to check the final source code of this tutorial.

Let’s start by creating a new Django project. Visit this beginner’s guide if you need help starting a Django project

Enter the command below to install the latest version Django on your machine.

After a…

A guide for submitting form using Fetch API to a Django-Backend without page refresh.

Submitting form data to the database/server without refreshing the page is an important technology in web application since it proves user experience. In such case, users don’t necessarily need to wait for a page reload to receive a response from the server.

Just before we get our hands dirty with codes, it is important that we know there a couple of ways form data can be sent to the database/server without refreshing the page. The original and working standard to achieve this is using built-in XMLHttpRequest…

Ways To Convert JavaScript Objects To Array

Converting Objects in JavaScript gives the chance to have access to some cool methods(like forEach(), filter(), etc) available while using an array.

In this tutorials, we will be looking into three techniques which objects can be changed in to array using any of these three methods: Object.keys(), Object.values(), and Object.entries()

Say we have a cart object defined as follow:

Using Object.keys():

We simply pass the name of the object into Object.keys(). Keys in the objects are converted into array

One of the cool features in modern JavaScript is the introduction of Arrow functions (also known as “fat arrow functions”). The ES6 arrow functions allow us to write more concise code for function expressions. It uses the => syntax.

The code below defines an ES5 function expression that multiply two numbers:

Now, here is a function which is the same as above but expressed as an arrow function:

We can see that the arrow function is shorter.

Arrow Function Syntax…

A function that operate on other functions, either by taking them as arguments or by returning them, are called higher-order functions

In most scenario, we do find ourselves working with data when programming. Ranging from collecting user information to making API calls, filtering through some set of information available, etc. There is a good chance that most of this data would be in an Array format.

The good news about JavaScript is that it provides us with some built-in functions that make working with Array extremely easy.

Having a basic understanding of how JavaScript Higher-Order functions work can make complex…

Basic Linux Commands You Should Know

There is a good chance that you’ll be working a lot of the time with the Terminal as a software developer. Linux is highly used in servers because they are super fast and secure. Windows is a good alternative but it costs in most cases.

In this tutorial, we will work you through some basic commands to use with Linux command-line interface(CLI). It is recommended to use CLI because it’s powerful and effective.

First off, fire up the Terminal by pressing Ctrl+Alt+T in Ubuntu. A Shell where you can start typing commands comes up immediately.

Basic Commands

1. pwd- Knowing the present…

String Formating & F-String syntax

Developers, throughout their development journey, would need to work with different data structures. Of the different data structures available in Python, a close look into Strings type would be considered in this lesson.

Before we dive into using the new F-string syntax introduced in Python 3.6, we’ll walk you through the old ways of formatting Strings. With that, you would obviously see why the newly improved syntax comes in handy.

Let’s have a simple code snippets to work with in order to have an idea of what is going on under the hood.

Consider the simple code below.

What Is A Virtual Environment ?

Simply put, Virtual Environment is a way of creating a specific container(environment) where modules and packages related to a particular project are saved. There are frequent cases where only a particular version of a package works inline with your specific project.

Say for instance, you have two different projects(Freelancing Project and Real Estate Project) at hands. For the Freelancing project you decide to go for Django Version 1.9 and Pillow Version 1.2 because Django 1.9 can only work with Pillow 1.2. For the Real Estate project you are using Django 3.0. and Pillow version 2.0. …

Ridwan Yusuf

l love writing code to solve problems 🛠️

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